Bug 916039 - Don't wrap |this| in strict mode eval. r=bhackett

--HG--
extra : rebase_source : 678d783f4cfe32a9b00db1a0bbb34940938bae0b
This commit is contained in:
Jan de Mooij 2013-09-13 17:51:50 +02:00
parent e0fe2d1079
commit 2c10974948
2 changed files with 6 additions and 2 deletions

View File

@ -0,0 +1,4 @@
(function() {
"use strict";
assertEq(eval("this"), undefined);
})();

View File

@ -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;