Debian Codegraph @

js/src/tests/test262/built-ins/JSON/parse/reviver-call-err.js

raw
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-internalizejsonproperty
5 description: >
6 Abrupt completion when reviver function returns an abrupt completion
7 info: |
8 JSON.parse ( text [ , reviver ] )
9
10 [...]
11 7. If IsCallable(reviver) is true, then
12 [...]
13 e. Return ? InternalizeJSONProperty(root, rootName).
14
15 Runtime Semantics: InternalizeJSONProperty ( holder, name)
16
17 [...]
18 3. Return ? Call(reviver, holder, « name, val »).
19 ---*/
20
21 assert.throws(Test262Error, function() {
22 JSON.parse('0', function() {
23 throw new Test262Error();
24 });
25 });
26
27 reportCompare(0, 0);