Bug 621432 - Properly reconstruct the pcstack when decompiling for an exception thrown during script prolog execution. r=jorendorff, a=beltzner

--HG--
extra : rebase_source : ed51ace3c3c045441ea2314e54cb458261d40f19
This commit is contained in:
Jeff Walden 2011-02-11 14:14:50 -08:00
Родитель 7ce1ece928
Коммит 96fdc3dfd9
3 изменённых файлов: 38 добавлений и 2 удалений

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

@ -5489,8 +5489,8 @@ ReconstructPCStack(JSContext *cx, JSScript *script, jsbytecode *target,
return ReconstructImacroPCStack(cx, script, imacstart, target, pcstack);
#endif
LOCAL_ASSERT(script->main <= target && target < script->code + script->length);
jsbytecode *pc = script->main;
LOCAL_ASSERT(script->code <= target && target < script->code + script->length);
jsbytecode *pc = script->code;
uintN pcdepth = 0;
ptrdiff_t oplen;
for (; pc < target; pc += oplen) {

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

@ -0,0 +1,35 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/
//-----------------------------------------------------------------------------
var BUGNUMBER = 621432;
var summary =
"If a var statement can't create a global property because the global " +
"object isn't extensible, and an error is thrown while decompiling the " +
"global, don't assert";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
var toSource = [];
Object.preventExtensions(this);
try
{
eval("var x;");
throw new Error("no error thrown");
}
catch (e)
{
assertEq(e instanceof TypeError, true, "expected TypeError, got: " + e);
}
/******************************************************************************/
if (typeof reportCompare === "function")
reportCompare(true, true);
print("All tests passed!");

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

@ -1,4 +1,5 @@
url-prefix ../../jsreftest.html?test=ecma_5/Global/
script adding-global-var-nonextensible-error.js
script parseInt-01.js
script parseFloat-01.js
script eval-01.js