зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset a1e877fa8d67 (bug 866450)
This commit is contained in:
Родитель
3b749d7033
Коммит
06d8f73264
|
@ -243,7 +243,7 @@ def CallOnUnforgeableHolder(descriptor, code, isXrayCheck=None):
|
||||||
JSObject* global = js::GetGlobalForObjectCrossCompartment(proxy);"""
|
JSObject* global = js::GetGlobalForObjectCrossCompartment(proxy);"""
|
||||||
|
|
||||||
return (pre + """
|
return (pre + """
|
||||||
JS::Rooted<JSObject*> unforgeableHolder(cx, GetUnforgeableHolder(global, prototypes::id::%s));
|
JSObject* unforgeableHolder = GetUnforgeableHolder(global, prototypes::id::%s);
|
||||||
""" + CGIndenter(CGGeneric(code)).define() + """
|
""" + CGIndenter(CGGeneric(code)).define() + """
|
||||||
}
|
}
|
||||||
""") % descriptor.name
|
""") % descriptor.name
|
||||||
|
@ -1204,7 +1204,7 @@ class CGClassHasInstanceHook(CGAbstractStaticMethod):
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
JS::Rooted<JSObject*> instance(cx, &vp.toObject());
|
JSObject* instance = &vp.toObject();
|
||||||
"""
|
"""
|
||||||
if self.descriptor.interface.hasInterfacePrototypeObject():
|
if self.descriptor.interface.hasInterfacePrototypeObject():
|
||||||
return header + """
|
return header + """
|
||||||
|
@ -2577,7 +2577,7 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
|
||||||
arrayRef = "${declName}"
|
arrayRef = "${declName}"
|
||||||
|
|
||||||
# NOTE: Keep this in sync with variadic conversions as needed
|
# NOTE: Keep this in sync with variadic conversions as needed
|
||||||
templateBody = ("""JS::Rooted<JSObject*> seq(cx, &${val}.toObject());\n
|
templateBody = ("""JSObject* seq = &${val}.toObject();\n
|
||||||
if (!IsArrayLike(cx, seq)) {
|
if (!IsArrayLike(cx, seq)) {
|
||||||
%s
|
%s
|
||||||
}
|
}
|
||||||
|
@ -2916,9 +2916,9 @@ for (uint32_t i = 0; i < length; ++i) {
|
||||||
else:
|
else:
|
||||||
holderType = "nsRefPtr<" + typeName + ">"
|
holderType = "nsRefPtr<" + typeName + ">"
|
||||||
templateBody += (
|
templateBody += (
|
||||||
"JS::Rooted<JS::Value> tmpVal(cx, ${val});\n" +
|
"jsval tmpVal = ${val};\n" +
|
||||||
typePtr + " tmp;\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,
|
templateBody += CGIndenter(onFailureBadType(failureCode,
|
||||||
descriptor.interface.identifier.name)).define()
|
descriptor.interface.identifier.name)).define()
|
||||||
templateBody += ("}\n"
|
templateBody += ("}\n"
|
||||||
|
@ -6782,7 +6782,7 @@ class CGDOMJSProxyHandler_hasOwn(ClassMethod):
|
||||||
"Should not have a XrayWrapper here");
|
"Should not have a XrayWrapper here");
|
||||||
|
|
||||||
""" + indexed + unforgeable + """
|
""" + indexed + unforgeable + """
|
||||||
JS::Rooted<JSObject*> expando(cx, GetExpandoObject(proxy));
|
JSObject* expando = GetExpandoObject(proxy);
|
||||||
if (expando) {
|
if (expando) {
|
||||||
JSBool b = true;
|
JSBool b = true;
|
||||||
JSBool ok = JS_HasPropertyById(cx, expando, id, &b);
|
JSBool ok = JS_HasPropertyById(cx, expando, id, &b);
|
||||||
|
@ -6818,7 +6818,7 @@ class CGDOMJSProxyHandler_get(ClassMethod):
|
||||||
hasUnforgeable)
|
hasUnforgeable)
|
||||||
else:
|
else:
|
||||||
getUnforgeableOrExpando = ""
|
getUnforgeableOrExpando = ""
|
||||||
getUnforgeableOrExpando += """JS::Rooted<JSObject*> expando(cx, DOMProxyHandler::GetExpandoObject(proxy));
|
getUnforgeableOrExpando += """JSObject* expando = DOMProxyHandler::GetExpandoObject(proxy);
|
||||||
if (expando) {
|
if (expando) {
|
||||||
JSBool hasProp;
|
JSBool hasProp;
|
||||||
if (!JS_HasPropertyById(cx, expando, id, &hasProp)) {
|
if (!JS_HasPropertyById(cx, expando, id, &hasProp)) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче