replacer-function-abrupt.js (800B)
1 // Copyright (C) 2019 Aleksey Shvayka. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: sec-serializejsonproperty 5 description: > 6 Abrupt completion from Call. 7 info: | 8 JSON.stringify ( value [ , replacer [ , space ] ] ) 9 10 [...] 11 4. If Type(replacer) is Object, then 12 a. If IsCallable(replacer) is true, then 13 i. Let ReplacerFunction be replacer. 14 [...] 15 12. Return ? SerializeJSONProperty(the empty String, wrapper). 16 17 SerializeJSONProperty ( key, holder ) 18 19 [...] 20 3. If ReplacerFunction is not undefined, then 21 a. Set value to ? Call(ReplacerFunction, holder, « key, value »). 22 ---*/ 23 24 assert.throws(Test262Error, function() { 25 JSON.stringify({}, function() { 26 throw new Test262Error(); 27 }); 28 }); 29 30 reportCompare(0, 0);