-
Notifications
You must be signed in to change notification settings - Fork 903
Open
Description
While testing refactoring of scope handling I've found that we may have mismatched calls to enterFrame and exitFrame while using generators. My stack handling in Context is like this:
private Scriptable scope;
public static class StackHandler {
private final Context cx;
private final Scriptable oldScope;
private final Scriptable currentScope;
private StackHandler(Context cx, Scriptable oldScope, Scriptable newScope) {
this.cx = cx;
this.oldScope = oldScope;
this.currentScope = newScope;
}
public void unwind() {
assert cx.scope == currentScope;
cx.scope = oldScope;
}
}
public StackHandler pushScope(Scriptable newScope) {
var res = new StackHandler(this, this.scope, newScope);
this.scope = newScope;
return res;
}and was done this way specifically to check pushing a scope and unwinding were always done in the right order.
enterFrame was altered to push the scope, and exitFrame to do the unwind. With this change continuation tests fail (which I kind of expected), but so do pretty much all tests which use generators, which suggests we've got a bug regarding those and enter / exit handling.
Metadata
Metadata
Assignees
Labels
No labels