diff options
-rw-r--r-- | src/components/script/dom/bindings/codegen/CodegenRust.py | 10 | ||||
-rw-r--r-- | src/test/wpt/metadata/dom/nodes/Node-insertBefore.html.ini | 11 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py index 5ee43b18e8c..7de2d949efe 100644 --- a/src/components/script/dom/bindings/codegen/CodegenRust.py +++ b/src/components/script/dom/bindings/codegen/CodegenRust.py @@ -586,7 +586,15 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None, "argument" % descriptor.interface.identifier.name) if failureCode is None: - unwrapFailureCode = "return 0; //XXXjdm return Throw(cx, rv);" + substitutions = { + "sourceDescription": sourceDescription, + "interface": descriptor.interface.identifier.name, + "exceptionCode": exceptionCode, + } + unwrapFailureCode = string.Template( + 'throw_type_error(cx, "${sourceDescription} does not ' + 'implement interface ${interface}.");\n' + '${exceptionCode}').substitute(substitutions) else: unwrapFailureCode = failureCode diff --git a/src/test/wpt/metadata/dom/nodes/Node-insertBefore.html.ini b/src/test/wpt/metadata/dom/nodes/Node-insertBefore.html.ini index abe89d60ac1..fa7f987c0dc 100644 --- a/src/test/wpt/metadata/dom/nodes/Node-insertBefore.html.ini +++ b/src/test/wpt/metadata/dom/nodes/Node-insertBefore.html.ini @@ -1,6 +1,11 @@ [Node-insertBefore.html] type: testharness - expected: TIMEOUT - [Calling insertBefore with a non-Node first argument must throw TypeError.] - expected: TIMEOUT + [If the context node is a document, inserting a document or text node should throw a HierarchyRequestError.] + expected: FAIL + + [If the context node is a DocumentFragment, inserting a document or a doctype should throw a HierarchyRequestError.] + expected: FAIL + + [If the context node is an element, inserting a document or a doctype should throw a HierarchyRequestError.] + expected: FAIL |