Bug 914341 - Fix BC to wrap primitive |this| in eval scripts. r=djvj

--HG--
extra : rebase_source : feea6164910b70dc8db175720c796c7b1aebca51
This commit is contained in:
Jan de Mooij 2013-09-12 11:14:20 +02:00
parent 2900cc6657
commit cd036919f1
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
function f() {
assertEq(typeof eval("this"), "object");
}
for (var i=0; i<5; i++)
f();

View File

@ -969,7 +969,7 @@ BaselineCompiler::emit_JSOP_THIS()
frame.pushThis();
// In strict mode function or self-hosted function, |this| is left alone.
if (!function() || function()->strict() || function()->isSelfHostedBuiltin())
if (function() && (function()->strict() || function()->isSelfHostedBuiltin()))
return true;
Label skipIC;