Bug 899238 - Make sure CPOW parent is never null (r=dvander).

This commit is contained in:
Bill McCloskey 2013-07-25 11:50:00 -07:00
parent 86cead439b
commit b51afaa42f

View File

@ -562,12 +562,14 @@ JavaScriptParent::unwrap(JSContext *cx, ObjectId objId)
bool callable = !!(objId & OBJECT_IS_CALLABLE);
RootedObject global(cx, JS_GetGlobalForScopeChain(cx));
RootedValue v(cx, UndefinedValue());
JSObject *obj = NewProxyObject(cx,
&CPOWProxyHandler::singleton,
v,
NULL,
NULL,
global,
callable ? ProxyIsCallable : ProxyNotCallable);
if (!obj)
return NULL;