| OLD | NEW |
| 1 Test JS objects as NodeFilters. | 1 Test JS objects as NodeFilters. |
| 2 | 2 |
| 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
| 4 | 4 |
| 5 | 5 |
| 6 Testing with raw function filter | 6 Testing with raw function filter |
| 7 filtering node A1 | 7 filtering node A1 |
| 8 PASS walker.firstChild(); walker.currentNode.id is 'A1' | 8 PASS walker.firstChild(); walker.currentNode.id is 'A1' |
| 9 filtering node B1 | 9 filtering node B1 |
| 10 filtering node B2 | 10 filtering node B2 |
| 11 PASS walker.nextNode(); walker.currentNode.id is 'B2' | 11 PASS walker.nextNode(); walker.currentNode.id is 'B2' |
| 12 | 12 |
| 13 Testing with object filter | 13 Testing with object filter |
| 14 filtering node A1 | 14 filtering node A1 |
| 15 PASS walker.firstChild(); walker.currentNode.id is 'A1' | 15 PASS walker.firstChild(); walker.currentNode.id is 'A1' |
| 16 filtering node B1 | 16 filtering node B1 |
| 17 filtering node B2 | 17 filtering node B2 |
| 18 PASS walker.nextNode(); walker.currentNode.id is 'B2' | 18 PASS walker.nextNode(); walker.currentNode.id is 'B2' |
| 19 | 19 |
| 20 Testing with null filter | 20 Testing with null filter |
| 21 PASS walker.firstChild(); walker.currentNode.id is 'A1' | 21 PASS walker.firstChild(); walker.currentNode.id is 'A1' |
| 22 PASS walker.nextNode(); walker.currentNode.id is 'B1' | 22 PASS walker.nextNode(); walker.currentNode.id is 'B1' |
| 23 | 23 |
| 24 Testing with undefined filter | 24 Testing with undefined filter |
| 25 PASS walker.firstChild(); walker.currentNode.id is 'A1' | 25 PASS walker.firstChild(); walker.currentNode.id is 'A1' |
| 26 PASS walker.nextNode(); walker.currentNode.id is 'B1' | 26 PASS walker.nextNode(); walker.currentNode.id is 'B1' |
| 27 | 27 |
| 28 Testing with object lacking acceptNode property | 28 Testing with object lacking acceptNode property |
| 29 PASS walker.firstChild(); threw exception TypeError: NodeFilter object does not
have an acceptNode function. | 29 PASS walker.firstChild(); threw exception TypeError: Failed to execute 'firstChi
ld' on 'TreeWalker': NodeFilter object does not have an acceptNode function. |
| 30 PASS walker.currentNode.id; is 'root' | 30 PASS walker.currentNode.id; is 'root' |
| 31 PASS walker.nextNode(); threw exception TypeError: NodeFilter object does not ha
ve an acceptNode function. | 31 PASS walker.nextNode(); threw exception TypeError: Failed to execute 'nextNode'
on 'TreeWalker': NodeFilter object does not have an acceptNode function. |
| 32 PASS walker.currentNode.id; is 'root' | 32 PASS walker.currentNode.id; is 'root' |
| 33 | 33 |
| 34 Testing with object with non-function acceptNode property | 34 Testing with object with non-function acceptNode property |
| 35 PASS walker.firstChild(); threw exception TypeError: NodeFilter object does not
have an acceptNode function. | 35 PASS walker.firstChild(); threw exception TypeError: Failed to execute 'firstChi
ld' on 'TreeWalker': NodeFilter object does not have an acceptNode function. |
| 36 PASS walker.currentNode.id; is 'root' | 36 PASS walker.currentNode.id; is 'root' |
| 37 PASS walker.nextNode(); threw exception TypeError: NodeFilter object does not ha
ve an acceptNode function. | 37 PASS walker.nextNode(); threw exception TypeError: Failed to execute 'nextNode'
on 'TreeWalker': NodeFilter object does not have an acceptNode function. |
| 38 PASS walker.currentNode.id; is 'root' | 38 PASS walker.currentNode.id; is 'root' |
| 39 | 39 |
| 40 Testing with function having acceptNode function | 40 Testing with function having acceptNode function |
| 41 PASS walker.firstChild(); walker.currentNode.id is 'A1' | 41 PASS walker.firstChild(); walker.currentNode.id is 'A1' |
| 42 PASS walker.nextNode(); walker.currentNode.id is 'B1' | 42 PASS walker.nextNode(); walker.currentNode.id is 'B1' |
| 43 | 43 |
| 44 Testing acceptNode callee | 44 Testing acceptNode callee |
| 45 Callee: function (node) { | 45 Callee: function (node) { |
| 46 debug('Callee: ' + arguments.callee); | 46 debug('Callee: ' + arguments.callee); |
| 47 return NodeFilter.FILTER_ACCEPT; | 47 return NodeFilter.FILTER_ACCEPT; |
| 48 } | 48 } |
| 49 PASS walker.firstChild(); walker.currentNode.id is 'A1' | 49 PASS walker.firstChild(); walker.currentNode.id is 'A1' |
| 50 PASS successfullyParsed is true | 50 PASS successfullyParsed is true |
| 51 | 51 |
| 52 TEST COMPLETE | 52 TEST COMPLETE |
| 53 | 53 |
| OLD | NEW |