Don't generate addprop PIC for JSOP_SETNAME, bug 735161. r=dvander

This commit is contained in:
Brian Hackett 2012-03-14 08:11:14 -07:00
Родитель 8708c2df91
Коммит 9de3d74777
2 изменённых файлов: 11 добавлений и 0 удалений

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

@ -0,0 +1,4 @@
var obj = {valueOf: function() { "use strict"; undeclared = 7; }};
try { '' + obj; assertEq(true, false); } catch(e) { }
try { '' + obj; assertEq(true, false); } catch(e) { }
assertEq("undeclared" in this, false);

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

@ -561,6 +561,13 @@ class SetPropCompiler : public PICStubCompiler
if (clasp->ops.defineProperty) if (clasp->ops.defineProperty)
return disable("ops define property hook"); return disable("ops define property hook");
/*
* Don't add properties for SETNAME, which requires checks in
* strict mode code.
*/
if (JSOp(*f.pc()) == JSOP_SETNAME)
return disable("add property under SETNAME");
/* /*
* When adding a property we need to check shapes along the entire * When adding a property we need to check shapes along the entire
* prototype chain to watch for an added setter. * prototype chain to watch for an added setter.