author | Phil Ringnalda <philringnalda@gmail.com> |
Tue, 20 Sep 2016 18:20:25 -0700 | |
changeset 314556 | dcebf2b98e14523c02905b82f03733086487a7fb |
parent 314555 | 9502a353f4dba3ff8f9be3496a7c46f21097093a |
child 314557 | fd291895b378fba58c48631972e66638c2e8dd21 |
push id | 81930 |
push user | philringnalda@gmail.com |
push date | Wed, 21 Sep 2016 01:20:32 +0000 |
treeherder | mozilla-inbound@dcebf2b98e14 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 1303118 |
milestone | 52.0a1 |
backs out | c9f2cb674778ded355d16e6d06f2fa22b49e99b3 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
js/src/frontend/Parser.cpp | file | annotate | diff | comparison | revisions | |
js/src/jit-test/tests/debug/Frame-evalWithBindings-15.js | file | annotate | diff | comparison | revisions |
--- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -282,29 +282,23 @@ EvalSharedContext::EvalSharedContext(Exc computeThisBinding(enclosingScope); // Like all things Debugger, Debugger.Frame.eval needs special // handling. Since the environment chain of such evals are non-syntactic // (DebuggerEnvironmentProxy is not an EnvironmentObject), computing the // 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(); } } } bool ParseContext::init() {
deleted file mode 100644 --- a/js/src/jit-test/tests/debug/Frame-evalWithBindings-15.js +++ /dev/null @@ -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(); -`);