зеркало из https://github.com/mozilla/gecko-dev.git
Bug 979730 part 2 - Remove saveFrameChain option from evaluate(). r=luke
This commit is contained in:
Родитель
d82809c969
Коммит
9cedfaf85f
|
@ -2,10 +2,7 @@
|
|||
try {
|
||||
evaluate("throw 3", {
|
||||
newContext: new Set,
|
||||
saveFrameChain: true
|
||||
});
|
||||
} catch(e) {}
|
||||
|
||||
evaluate("()", {
|
||||
saveFrameChain: true
|
||||
});
|
||||
evaluate("()", {});
|
||||
|
|
|
@ -4,7 +4,7 @@ evalcx("\
|
|||
y = evaluate(\"Object.defineProperty(this,\\\"y\\\",\
|
||||
{get: function() {}}\
|
||||
);\",\
|
||||
{catchTermination: true, saveFrameChain: true}\
|
||||
{catchTermination: true}\
|
||||
);\
|
||||
}",
|
||||
newGlobal('')
|
||||
|
@ -13,7 +13,6 @@ evalcx("\
|
|||
evalcx("\
|
||||
for (x = 0; x < 1; ++x) { \
|
||||
v = evaluate(\"gc\",{ \
|
||||
saveFrameChain: true \
|
||||
})\
|
||||
}\
|
||||
", newGlobal(''));
|
||||
|
|
|
@ -2,5 +2,4 @@
|
|||
Error.prototype.toString = Function;
|
||||
evaluate("n f", {
|
||||
noScriptRval: true,
|
||||
saveFrameChain: true
|
||||
});
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
// Error().stack (ScriptFrameIter) should see through JS_SaveFrameChain.
|
||||
function gamma() {
|
||||
stack = Error().stack;
|
||||
}
|
||||
function beta() {
|
||||
evaluate("gamma()", {saveFrameChain: true});
|
||||
}
|
||||
function alpha() {
|
||||
beta();
|
||||
}
|
||||
alpha();
|
||||
|
||||
assertEq(/alpha/.test(stack), true);
|
||||
assertEq(/beta/.test(stack), true);
|
||||
assertEq(/gamma/.test(stack), true);
|
|
@ -1334,30 +1334,6 @@ CacheEntry_setBytecode(JSContext* cx, HandleObject cache, uint8_t* buffer, uint3
|
|||
return true;
|
||||
}
|
||||
|
||||
class AutoSaveFrameChain
|
||||
{
|
||||
JSContext* cx_;
|
||||
bool saved_;
|
||||
|
||||
public:
|
||||
explicit AutoSaveFrameChain(JSContext* cx)
|
||||
: cx_(cx),
|
||||
saved_(false)
|
||||
{}
|
||||
|
||||
bool save() {
|
||||
if (!JS_SaveFrameChain(cx_))
|
||||
return false;
|
||||
saved_ = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
~AutoSaveFrameChain() {
|
||||
if (saved_)
|
||||
JS_RestoreFrameChain(cx_);
|
||||
}
|
||||
};
|
||||
|
||||
static bool
|
||||
Evaluate(JSContext* cx, unsigned argc, Value* vp)
|
||||
{
|
||||
|
@ -1391,7 +1367,6 @@ Evaluate(JSContext* cx, unsigned argc, Value* vp)
|
|||
RootedString sourceMapURL(cx);
|
||||
RootedObject global(cx, nullptr);
|
||||
bool catchTermination = false;
|
||||
bool saveFrameChain = false;
|
||||
bool loadBytecode = false;
|
||||
bool saveBytecode = false;
|
||||
bool assertEqBytecode = false;
|
||||
|
@ -1452,11 +1427,6 @@ Evaluate(JSContext* cx, unsigned argc, Value* vp)
|
|||
if (!v.isUndefined())
|
||||
catchTermination = ToBoolean(v);
|
||||
|
||||
if (!JS_GetProperty(cx, opts, "saveFrameChain", &v))
|
||||
return false;
|
||||
if (!v.isUndefined())
|
||||
saveFrameChain = ToBoolean(v);
|
||||
|
||||
if (!JS_GetProperty(cx, opts, "loadBytecode", &v))
|
||||
return false;
|
||||
if (!v.isUndefined())
|
||||
|
@ -1506,10 +1476,6 @@ Evaluate(JSContext* cx, unsigned argc, Value* vp)
|
|||
}
|
||||
|
||||
{
|
||||
AutoSaveFrameChain asfc(cx);
|
||||
if (saveFrameChain && !asfc.save())
|
||||
return false;
|
||||
|
||||
JSAutoCompartment ac(cx, global);
|
||||
RootedScript script(cx);
|
||||
|
||||
|
@ -5300,8 +5266,6 @@ static const JSFunctionSpecWithHelp shell_functions[] = {
|
|||
" columnNumber: starting column number for error messages and debug info\n"
|
||||
" global: global in which to execute the code\n"
|
||||
" newContext: if true, create and use a new cx (default: false)\n"
|
||||
" saveFrameChain: if true, save the frame chain before evaluating code\n"
|
||||
" and restore it afterwards\n"
|
||||
" catchTermination: if true, catch termination (failure without\n"
|
||||
" an exception value, as for slow scripts or out-of-memory)\n"
|
||||
" and return 'terminated'\n"
|
||||
|
|
Загрузка…
Ссылка в новой задаче