3 <title>Test for ...
</title>
4 <script src=
"/resources/testharness.js"></script>
5 <script src=
"/resources/testharnessreport.js"></script>
8 /* global promise_test, promise_rejects */
10 promise_test(function(t
) {
11 var iterator
= document
.createNodeIterator(document
, NodeFilter
.SHOW_ALL
, JSON
.parse
);
12 return promise_rejects(t
, new SyntaxError
,
13 Promise
.resolve().then(iterator
.nextNode
.bind(iterator
)));
14 }, "Trying to use JSON.parse as filter should throw a catchable SyntaxError exception even when the filter is invoked async");
16 promise_test(function(t
) {
17 return promise_rejects(t
, new SyntaxError
, Promise
.resolve("{").then(JSON
.parse
));
18 }, "Trying to use JSON.parse as a promise callback should allow the next promise to handle the resulting exception.");