| 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 |
es6id: 24.3.1.1 |
| 6 |
description: > |
| 7 |
Abrupt completion when reviver function returns an abrupt completion |
| 8 |
info: | |
| 9 |
JSON.parse ( text [ , reviver ] ) |
| 10 |
|
| 11 |
[...] |
| 12 |
7. If IsCallable(reviver) is true, then |
| 13 |
[...] |
| 14 |
e. Return ? InternalizeJSONProperty(root, rootName). |
| 15 |
|
| 16 |
Runtime Semantics: InternalizeJSONProperty ( holder, name) |
| 17 |
|
| 18 |
[...] |
| 19 |
3. Return ? Call(reviver, holder, « name, val »). |
| 20 |
---*/ |
| 21 |
|
| 22 |
assert.throws(Test262Error, function() { |
| 23 |
JSON.parse('0', function() { |
| 24 |
throw new Test262Error(); |
| 25 |
}); |
| 26 |
}); |