Bug 555246 - Wrong answer for 'this' in function code when entry frame was produced by a call across globals. r=brendan.

This commit is contained in:
Jason Orendorff 2010-04-01 09:56:25 -05:00
Родитель 28e6b99814
Коммит 00195a52fa
4 изменённых файлов: 25 добавлений и 1 удалений

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

@ -2751,7 +2751,7 @@ BEGIN_CASE(JSOP_CALLGVAR)
rval = obj->getSlotMT(cx, slot);
PUSH_OPND(rval);
if (op == JSOP_CALLGVAR)
PUSH_OPND(OBJECT_TO_JSVAL(obj));
PUSH_OPND(JSVAL_NULL);
END_CASE(JSOP_GETGVAR)
BEGIN_CASE(JSOP_SETGVAR)

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

@ -8,3 +8,5 @@ script regress-541255-3.js
script regress-541255-4.js
script regress-541455.js
script regress-546615.js
script regress-555246-0.js
fails script regress-555246-1.js

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

@ -0,0 +1,11 @@
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/licenses/publicdomain/
* Contributor: Jason Orendorff
*/
var cx = evalcx("");
evalcx("function f() { return this; }", cx);
var f = cx.f;
assertEq(f(), cx);
reportCompare(0, 0, "");

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

@ -0,0 +1,11 @@
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/licenses/publicdomain/
* Contributor: Jason Orendorff
*/
var cx = evalcx("");
evalcx("function f() { return this; }", cx);
f = cx.f;
assertEq(f(), cx);
reportCompare(0, 0, "");