diff --git a/js/src/jit-test/tests/baseline/bug916039.js b/js/src/jit-test/tests/baseline/bug916039.js new file mode 100644 index 000000000000..f35d31ceb081 --- /dev/null +++ b/js/src/jit-test/tests/baseline/bug916039.js @@ -0,0 +1,4 @@ +(function() { + "use strict"; + assertEq(eval("this"), undefined); +})(); diff --git a/js/src/jit/BaselineCompiler.cpp b/js/src/jit/BaselineCompiler.cpp index 867d944aaee9..11c17ec9e5f0 100644 --- a/js/src/jit/BaselineCompiler.cpp +++ b/js/src/jit/BaselineCompiler.cpp @@ -971,8 +971,8 @@ BaselineCompiler::emit_JSOP_THIS() // Keep this value in R0 frame.pushThis(); - // In strict mode function or self-hosted function, |this| is left alone. - if (function() && (function()->strict() || function()->isSelfHostedBuiltin())) + // In strict mode code or self-hosted functions, |this| is left alone. + if (script->strict || (function() && function()->isSelfHostedBuiltin())) return true; Label skipIC;