public static void main(String[] args) throws Exception {
if(args.length == 0) { System.err.println("Usage Test filename"); System.exit(1); }
- JS f = JS.fromReader(args[0],1,new FileReader(args[0]));
+ JS f = Script.fromReader(args[0],1,new FileReader(args[0]));
System.out.println(((JSFunction)f).dump());
- JS s = new JS.O();
+ JS s = new JS.Obj();
s.put(Script.S("sys"),new Test());
f = Script.cloneWithNewGlobalScope(f,s);
//JS ret = f.call(null,null,null,null,0);
}
public JS callMethod(JS method, JS a0, JS a1, JS a2, JS[] rest, int nargs) throws JSExn {
- if(!JS.isString(method)) return null;
+ if(!Script.isString(method)) return null;
if("print".equals(Script.toString(method))) {
System.out.println(Script.str(a0));
return null;
}
- if("clone".equals(Script.toString(method))) return a0 == null ? null : a0.jsclone();
+ if("clone".equals(Script.toString(method))) return a0 == null ? null : new JS.Clone(a0);
if("firethis".equals(Script.toString(method))) {
String action = Script.toString(a0);
JS target = a1;