зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset c9f2cb674778 (bug 1303118) for failures in browser_dbg_watch-expressions-02.js
This commit is contained in:
Родитель
9f272ce341
Коммит
86d3aebd18
|
@ -287,19 +287,13 @@ EvalSharedContext::EvalSharedContext(ExclusiveContext* cx, JSObject* enclosingEn
|
|||
// this binding with respect to enclosingScope is incorrect if the
|
||||
// Debugger.Frame is a function frame. Recompute the this binding if we
|
||||
// are such an eval.
|
||||
if (enclosingEnv && enclosingScope->kind() == ScopeKind::NonSyntactic) {
|
||||
// For Debugger.Frame.eval with bindings, the environment chain may
|
||||
// have more than the DebugEnvironmentProxy.
|
||||
JSObject* env = enclosingEnv;
|
||||
if (enclosingEnv && enclosingEnv->is<DebugEnvironmentProxy>()) {
|
||||
JSObject* env = &enclosingEnv->as<DebugEnvironmentProxy>().environment();
|
||||
while (env) {
|
||||
if (env->is<DebugEnvironmentProxy>())
|
||||
env = &env->as<DebugEnvironmentProxy>().environment();
|
||||
|
||||
if (env->is<CallObject>()) {
|
||||
computeThisBinding(env->as<CallObject>().callee().nonLazyScript()->bodyScope());
|
||||
break;
|
||||
}
|
||||
|
||||
env = env->enclosingEnvironment();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
var g = newGlobal();
|
||||
var dbg = new Debugger(g);
|
||||
|
||||
dbg.onDebuggerStatement = function (frame) {
|
||||
// The bindings object is unused but adds another environment on the
|
||||
// environment chain. Make sure 'this' computes the right value in light of
|
||||
// this.
|
||||
frame.evalWithBindings(`assertEq(this, foo);`, { bar: 42 });
|
||||
};
|
||||
|
||||
g.eval(`
|
||||
var foo = { bar: function() { debugger; } };
|
||||
foo.bar();
|
||||
`);
|
Загрузка…
Ссылка в новой задаче