mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
Throw a TypeError when get_callable_property encounters a value that isn't callable.
This commit is contained in:
parent
0607cd3fb5
commit
90a7ef1571
3 changed files with 8 additions and 14 deletions
|
@ -1,3 +0,0 @@
|
|||
[TreeWalker-acceptNode-filter.html]
|
||||
type: testharness
|
||||
expected: CRASH
|
|
@ -85,23 +85,21 @@ test(function()
|
|||
assert_node(walker.currentNode, { type: Element, id: 'B1' });
|
||||
}, 'Testing with undefined filter');
|
||||
|
||||
// XXX Servo breaks the test when a callback isn't callable
|
||||
test(function()
|
||||
{
|
||||
var walker = document.createTreeWalker(testElement, /*NodeFilter.*/SHOW_ELEMENT, {});
|
||||
assert_throws(null, function () { walker.firstChild(); });
|
||||
assert_throws(new TypeError(), function () { walker.firstChild(); });
|
||||
assert_node(walker.currentNode, { type: Element, id: 'root' });
|
||||
assert_throws(null, function () { walker.nextNode(); });
|
||||
assert_throws(new TypeError(), function () { walker.nextNode(); });
|
||||
assert_node(walker.currentNode, { type: Element, id: 'root' });
|
||||
}, 'Testing with object lacking acceptNode property');
|
||||
|
||||
// XXX Servo breaks the test when a callback isn't callable
|
||||
test(function()
|
||||
{
|
||||
var walker = document.createTreeWalker(testElement, /*NodeFilter.*/SHOW_ELEMENT, { acceptNode: "foo" });
|
||||
assert_throws(null, function () { walker.firstChild(); });
|
||||
assert_throws(new TypeError(), function () { walker.firstChild(); });
|
||||
assert_node(walker.currentNode, { type: Element, id: 'root' });
|
||||
assert_throws(null, function () { walker.nextNode(); });
|
||||
assert_throws(new TypeError(), function () { walker.nextNode(); });
|
||||
assert_node(walker.currentNode, { type: Element, id: 'root' });
|
||||
}, 'Testing with object with non-function acceptNode property');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue