- f = JS.cloneWithNewParentScope(f,s);
- JS ret = f.call(null,null,null,null,0);
+ f = JS.cloneWithNewGlobalScope(f,s);
+ //JS ret = f.call(null,null,null,null,0);
+ Interpreter i = new Interpreter((JSFunction)f, true, new Interpreter.JSArgs(f));
+ JS ret = i.resume();
+ while(up != null) {
+ JS.UnpauseCallback up = Test.up; Test.up = null;
+ if("throw".equals(action)) ret = up.unpause(new JSExn("this was thrown to a paused context"));
+ else if("bgget".equals(action)) ret = up.unpause(JS.S("I'm returning this from a get request"));
+ else {
+ System.out.println("got a background put " + action);
+ ret = up.unpause();
+ }
+ }