Throw a TypeError when a non-object is passed where one is expected.

This commit is contained in:
Ms2ger 2014-07-30 17:55:28 +02:00
parent ea621676f2
commit 83cc23089a
7 changed files with 83 additions and 18 deletions

View file

@ -497,7 +497,7 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
return CGWrapper( return CGWrapper(
CGGeneric( CGGeneric(
failureCode or failureCode or
('//XXXjdm ThrowErrorMessage(cx, MSG_NOT_OBJECT, "%s");\n' ('throw_type_error(cx, "%s is not an object.");\n'
'%s' % (firstCap(sourceDescription), exceptionCode))), '%s' % (firstCap(sourceDescription), exceptionCode))),
post="\n") post="\n")
def onFailureBadType(failureCode, typeName): def onFailureBadType(failureCode, typeName):

View file

@ -1,6 +1,3 @@
[open-url-javascript-window-2.htm] [open-url-javascript-window-2.htm]
type: testharness type: testharness
expected: TIMEOUT expected: TIMEOUT
[XMLHttpRequest: open() - resolving URLs (javascript: ]
expected: TIMEOUT

View file

@ -1,6 +1,3 @@
[open-url-javascript-window.htm] [open-url-javascript-window.htm]
type: testharness type: testharness
expected: TIMEOUT expected: TIMEOUT
[XMLHttpRequest: open() - resolving URLs (javascript: ]
expected: TIMEOUT

View file

@ -1,6 +1,5 @@
[responsetext-decoding.htm] [responsetext-decoding.htm]
type: testharness type: testharness
expected: TIMEOUT
[XMLHttpRequest: responseText decoding (text/plain %FE%FF)] [XMLHttpRequest: responseText decoding (text/plain %FE%FF)]
expected: FAIL expected: FAIL

View file

@ -1,9 +1,83 @@
[DOMImplementation-createDocument.html] [DOMImplementation-createDocument.html]
type: testharness type: testharness
expected: TIMEOUT [createDocument test 2: null,undefined,null,null]
[DOMImplementation.createDocument(namespace, qualifiedName, doctype)] expected: FAIL
expected: TIMEOUT
[createDocument test 0: null,null,false,object "TypeError"] [createDocument test 4: null,"foo",null,null]
expected: TIMEOUT expected: FAIL
[createDocument test 6: null,"f1oo",null,null]
expected: FAIL
[createDocument test 7: null,"foo1",null,null]
expected: FAIL
[createDocument test 11: null,"xml",null,null]
expected: FAIL
[createDocument test 12: null,"xmlns",null,"NAMESPACE_ERR"]
expected: FAIL
[createDocument test 13: null,"xmlfoo",null,null]
expected: FAIL
[createDocument test 18: undefined,undefined,undefined,null]
expected: FAIL
[createDocument test 20: undefined,"foo",undefined,null]
expected: FAIL
[createDocument test 22: undefined,"f1oo",undefined,null]
expected: FAIL
[createDocument test 23: undefined,"foo1",undefined,null]
expected: FAIL
[createDocument test 27: undefined,"xml",undefined,null]
expected: FAIL
[createDocument test 28: undefined,"xmlns",undefined,"NAMESPACE_ERR"]
expected: FAIL
[createDocument test 29: undefined,"xmlfoo",undefined,null]
expected: FAIL
[createDocument test 41: "http://example.com/","foo:",null,"NAMESPACE_ERR"]
expected: FAIL
[createDocument test 43: "http://example.com/","xmlns",null,"NAMESPACE_ERR"]
expected: FAIL
[createDocument test 46: "http://example.com/","xmlns:foo",null,"NAMESPACE_ERR"]
expected: FAIL
[createDocument test 56: "/","foo:",null,"NAMESPACE_ERR"]
expected: FAIL
[createDocument test 58: "/","xmlns",null,"NAMESPACE_ERR"]
expected: FAIL
[createDocument test 61: "/","xmlns:foo",null,"NAMESPACE_ERR"]
expected: FAIL
[createDocument test 71: "http://www.w3.org/XML/1998/namespace","foo:",null,"NAMESPACE_ERR"]
expected: FAIL
[createDocument test 73: "http://www.w3.org/XML/1998/namespace","xmlns",null,"NAMESPACE_ERR"]
expected: FAIL
[createDocument test 76: "http://www.w3.org/XML/1998/namespace","xmlns:foo",null,"NAMESPACE_ERR"]
expected: FAIL
[createDocument test 101: "foo:","foo:",null,"NAMESPACE_ERR"]
expected: FAIL
[createDocument test 103: "foo:","xmlns",null,"NAMESPACE_ERR"]
expected: FAIL
[createDocument test 106: "foo:","xmlns:foo",null,"NAMESPACE_ERR"]
expected: FAIL
[createDocument test 113: null,"foo",DocumentType node,null]
expected: FAIL

View file

@ -1,6 +1,5 @@
[Element-childElementCount-dynamic-remove.html] [Element-childElementCount-dynamic-remove.html]
type: testharness type: testharness
expected: TIMEOUT
[Dynamic Removal of Elements] [Dynamic Removal of Elements]
expected: TIMEOUT expected: FAIL

View file

@ -1,6 +1,5 @@
[Node-replaceChild.html] [Node-replaceChild.html]
type: testharness type: testharness
expected: TIMEOUT [If child\'s parent is not the context node, a NotFoundError exception should be thrown]
[Passing null to replaceChild should throw a TypeError.] expected: FAIL
expected: TIMEOUT