diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/JSON/stringify/value-object-abrupt.js')
-rw-r--r-- | js/src/tests/test262/built-ins/JSON/stringify/value-object-abrupt.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/JSON/stringify/value-object-abrupt.js b/js/src/tests/test262/built-ins/JSON/stringify/value-object-abrupt.js new file mode 100644 index 0000000000..131d1041d0 --- /dev/null +++ b/js/src/tests/test262/built-ins/JSON/stringify/value-object-abrupt.js @@ -0,0 +1,26 @@ +// Copyright (C) 2019 Aleksey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-serializejsonproperty +description: > + Abrupt completion from Get. +info: | + JSON.stringify ( value [ , replacer [ , space ] ] ) + + [...] + 12. Return ? SerializeJSONProperty(the empty String, wrapper). + + SerializeJSONProperty ( key, holder ) + + 1. Let value be ? Get(holder, key). +---*/ + +assert.throws(Test262Error, function() { + JSON.stringify({ + get key() { + throw new Test262Error(); + }, + }); +}); + +reportCompare(0, 0); |