Bug 736807 - InitExnPrivate needs to root values since they can now be wrapped (r=bholley)

--HG--
extra : rebase_source : 4aeb6c6b271588c57c4b6e166c630a72c8c7d0d5
This commit is contained in:
Luke Wagner 2012-03-19 10:49:12 -07:00
parent 0dac431db3
commit 176cb177d1
2 changed files with 15 additions and 3 deletions

View File

@ -0,0 +1,12 @@
function f() {
newGlobal('new-compartment').eval('\
try {\
gczeal(2,1); \
throw new Error();\
} catch (e) { \
gc(); \
assertEq("" + e, "Error"); \
} \
');
}
f({}, [1,2,4,5,6,7,8,1], new RegExp(), function() {});

View File

@ -292,8 +292,8 @@ struct SuppressErrorsGuard
struct AppendWrappedArg {
JSContext *cx;
Vector<Value> &values;
AppendWrappedArg(JSContext *cx, Vector<Value> &values)
AutoValueVector &values;
AppendWrappedArg(JSContext *cx, AutoValueVector &values)
: cx(cx),
values(values)
{}
@ -342,7 +342,7 @@ InitExnPrivate(JSContext *cx, JSObject *exnObject, JSString *message,
JSCheckAccessOp checkAccess = cx->runtime->securityCallbacks->checkObjectAccess;
Vector<JSStackTraceStackElem> frames(cx);
Vector<Value> values(cx);
AutoValueVector values(cx);
{
SuppressErrorsGuard seg(cx);
for (FrameRegsIter i(cx); !i.done(); ++i) {