diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index d62de2c9bdc3..0d1ea36adc04 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -243,7 +243,7 @@ def CallOnUnforgeableHolder(descriptor, code, isXrayCheck=None): JSObject* global = js::GetGlobalForObjectCrossCompartment(proxy);""" return (pre + """ - JS::Rooted unforgeableHolder(cx, GetUnforgeableHolder(global, prototypes::id::%s)); + JSObject* unforgeableHolder = GetUnforgeableHolder(global, prototypes::id::%s); """ + CGIndenter(CGGeneric(code)).define() + """ } """) % descriptor.name @@ -1204,7 +1204,7 @@ class CGClassHasInstanceHook(CGAbstractStaticMethod): return true; } - JS::Rooted instance(cx, &vp.toObject()); + JSObject* instance = &vp.toObject(); """ if self.descriptor.interface.hasInterfacePrototypeObject(): return header + """ @@ -2577,7 +2577,7 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None, arrayRef = "${declName}" # NOTE: Keep this in sync with variadic conversions as needed - templateBody = ("""JS::Rooted seq(cx, &${val}.toObject());\n + templateBody = ("""JSObject* seq = &${val}.toObject();\n if (!IsArrayLike(cx, seq)) { %s } @@ -2916,9 +2916,9 @@ for (uint32_t i = 0; i < length; ++i) { else: holderType = "nsRefPtr<" + typeName + ">" templateBody += ( - "JS::Rooted tmpVal(cx, ${val});\n" + + "jsval tmpVal = ${val};\n" + typePtr + " tmp;\n" - "if (NS_FAILED(xpc_qsUnwrapArg<" + typeName + ">(cx, ${val}, &tmp, static_cast<" + typeName + "**>(getter_AddRefs(${holderName})), tmpVal.address()))) {\n") + "if (NS_FAILED(xpc_qsUnwrapArg<" + typeName + ">(cx, ${val}, &tmp, static_cast<" + typeName + "**>(getter_AddRefs(${holderName})), &tmpVal))) {\n") templateBody += CGIndenter(onFailureBadType(failureCode, descriptor.interface.identifier.name)).define() templateBody += ("}\n" @@ -6782,7 +6782,7 @@ class CGDOMJSProxyHandler_hasOwn(ClassMethod): "Should not have a XrayWrapper here"); """ + indexed + unforgeable + """ -JS::Rooted expando(cx, GetExpandoObject(proxy)); +JSObject* expando = GetExpandoObject(proxy); if (expando) { JSBool b = true; JSBool ok = JS_HasPropertyById(cx, expando, id, &b); @@ -6818,7 +6818,7 @@ class CGDOMJSProxyHandler_get(ClassMethod): hasUnforgeable) else: getUnforgeableOrExpando = "" - getUnforgeableOrExpando += """JS::Rooted expando(cx, DOMProxyHandler::GetExpandoObject(proxy)); + getUnforgeableOrExpando += """JSObject* expando = DOMProxyHandler::GetExpandoObject(proxy); if (expando) { JSBool hasProp; if (!JS_HasPropertyById(cx, expando, id, &hasProp)) {