From e8f3c9fa9828d8bbf6a5d8e034ee4666b8a23953 Mon Sep 17 00:00:00 2001 From: Eric Faust Date: Tue, 31 Jul 2012 20:45:22 -0700 Subject: [PATCH] Bug 749535 - Part 3: Remove JS_Is*Array() from Paris Binding argument unwrapping. (r=bz) --- dom/bindings/Codegen.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index cc78cbcc4e48..397f748f9a60 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -1972,19 +1972,13 @@ for (uint32_t i = 0; i < length; ++i) { "arraybuffer views because making sure all the " "objects are properly rooted is hard") name = type.name - if type.isArrayBuffer(): - jsname = "ArrayBufferObject" - elif type.isArrayBufferView(): - jsname = "ArrayBufferViewObject" - else: - jsname = type.name - # By default, we use a Maybe<> to hold our typed array. And in the optional # non-nullable case we want to pass Optional to consumers, not # Optional >, so jump though some hoops to do that. holderType = "Maybe<%s>" % name constructLoc = "${holderName}" constructMethod = "construct" + constructInternal = "ref" if type.nullable(): if isOptional: declType = "const Optional<" + name + "*>" @@ -1997,15 +1991,16 @@ for (uint32_t i = 0; i < length; ++i) { holderType = None constructLoc = "(const_cast& >(${declName}))" constructMethod = "Construct" + constructInternal = "Value" else: declType = "NonNull<" + name + ">" template = ( - "if (!JS_Is%s(&${val}.toObject(), cx)) {\n" + "%s.%s(cx, &${val}.toObject());\n" + "if (!%s.%s().inited()) {\n" "%s" # No newline here because onFailure() handles that - "}\n" - "%s.%s(cx, &${val}.toObject());\n" % - (jsname, CGIndenter(onFailure(failureCode, descriptorProvider.workers)).define(), - constructLoc, constructMethod)) + "}\n" % + (constructLoc, constructMethod, constructLoc, constructInternal, + CGIndenter(onFailure(failureCode, descriptorProvider.workers)).define())) nullableTarget = "" if type.nullable(): if isOptional: