Backed out changeset c9f2cb674778 (bug 1303118) for failures in browser_dbg_watch-expressions-02.js

This commit is contained in:
Phil Ringnalda 2016-09-20 18:20:25 -07:00
Родитель 9f272ce341
Коммит 86d3aebd18
2 изменённых файлов: 2 добавлений и 22 удалений

Просмотреть файл

@ -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();
`);