- if("clone".equals(JS.toString(method))) return a0 == null ? null : a0.jsclone();
- if("firethis".equals(JS.toString(method))) {
- String action = JS.toString(a0);
- JS target = a1;
- JS key = a2;
- if(action.equals("get")) return a1.getAndTriggerTraps(key);
- else if(action.equals("put")) a1.putAndTriggerTraps(key,JS.S("some value"));
- else if(action.equals("trigger")) return target.justTriggerTraps(key,JS.S("some trigger value"));
+ if("clone".equals(JSU.toString(method)))
+ return args.length < 1 || args[0] == null ? null : new JS.Clone(args[0]);
+ if("firethis".equals(JSU.toString(method))) {
+ String action = JSU.toString(args[0]);
+ JS target = args[1];
+ JS key = args[2];
+ if(action.equals("get")) return args[1].getAndTriggerTraps(key);
+ else if(action.equals("put")) args[1].putAndTriggerTraps(key,JSU.S("some value"));
+ else if(action.equals("trigger")) return target.justTriggerTraps(key,JSU.S("some trigger value"));