browser.js |
|
0 |
builtin.js |
---
esid: sec-json.stringify
description: >
Tests that JSON.stringify meets the requirements
for built-in objects defined by the introduction of chapter 17 of
the ECMAScript Language Specification.
features: [Reflect.construct]
--- |
985 |
length.js |
---
esid: sec-json.stringify
description: >
JSON.stringify.length is 3.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
The "length" property of the stringify function is 3.
ECMAScript Standard Built-in Objects
Unless otherwise specified, the length property of a built-in Function
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
[[Configurable]]: true }.
includes: [propertyHelper.js]
--- |
725 |
name.js |
---
esid: sec-json.stringify
description: >
JSON.stringify.name is "stringify".
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, that is not
identified as an anonymous function has a name property whose value
is a String.
Unless otherwise specified, the name property of a built-in Function
object, if it exists, has the attributes { [[Writable]]: false,
[[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
--- |
865 |
not-a-constructor.js |
---
esid: sec-ecmascript-standard-built-in-objects
description: >
JSON.stringify does not implement [[Construct]], is not new-able
info: |
ECMAScript Function Objects
Built-in function objects that are not identified as constructors do not
implement the [[Construct]] internal method unless otherwise specified in
the description of a particular function.
sec-evaluatenew
...
7. If IsConstructor(constructor) is false, throw a TypeError exception.
...
includes: [isConstructor.js]
features: [Reflect.construct, arrow-function]
--- |
880 |
prop-desc.js |
---
esid: sec-json.stringify
description: >
Property descriptor of JSON.stringify.
info: |
ECMAScript Standard Built-in Objects
Every other data property described in clauses 18 through 26 and in Annex B.2
has the attributes { [[Writable]]: true, [[Enumerable]]: false,
[[Configurable]]: true } unless otherwise specified.
includes: [propertyHelper.js]
--- |
630 |
property-order.js |
---
esid: sec-serializejsonobject
description: JSON.stringify property enumeration order
features: [for-in-order]
--- |
797 |
replacer-array-abrupt.js |
---
esid: sec-json.stringify
description: >
Abrupt completion from Get.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
4. If Type(replacer) is Object, then
[...]
2. Let len be ? LengthOfArrayLike(replacer).
3. Let k be 0.
4. Repeat, while k < len,
a. Let v be ? Get(replacer, ! ToString(k)).
features: [Proxy]
--- |
1281 |
replacer-array-duplicates.js |
---
esid: sec-json.stringify
description: >
Replacer array is deduped before Get.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
4. If Type(replacer) is Object, then
[...]
4. Repeat, while k < len,
a. Let v be ? Get(replacer, ! ToString(k)).
[...]
f. If item is not undefined and item is not currently an element of PropertyList, then
i. Append item to the end of PropertyList.
--- |
797 |
replacer-array-empty.js |
---
esid: sec-serializejsonobject
description: >
Objects are serialized to {} if replacer array is empty.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
10. If Type(value) is Object and IsCallable(value) is false, then
[...]
c. Return ? SerializeJSONObject(value).
SerializeJSONObject ( value )
[...]
5. If PropertyList is not undefined, then
a. Let K be PropertyList.
--- |
896 |
replacer-array-number-object.js |
---
esid: sec-json.stringify
description: >
Converts Number objects from replacer array to primitives using ToString.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
4. If Type(replacer) is Object, then
[...]
4. Repeat, while k < len,
a. Let v be ? Get(replacer, ! ToString(k)).
[...]
e. Else if Type(v) is Object, then
i. If v has a [[StringData]] or [[NumberData]] internal slot,
set item to ? ToString(v).
--- |
917 |
replacer-array-number.js |
---
esid: sec-json.stringify
description: >
Converts number primitives from replacer array to strings.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
4. If Type(replacer) is Object, then
[...]
4. Repeat, while k < len,
a. Let v be ? Get(replacer, ! ToString(k)).
[...]
d. Else if Type(v) is Number, set item to ! ToString(v).
--- |
772 |
replacer-array-order.js |
---
esid: sec-serializejsonobject
description: >
Keys order of serialized objects is determined by replacer array.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
10. If Type(value) is Object and IsCallable(value) is false, then
[...]
c. Return ? SerializeJSONObject(value).
SerializeJSONObject ( value )
[...]
5. If PropertyList is not undefined, then
a. Let K be PropertyList.
--- |
922 |
replacer-array-proxy-revoked-realm.js |
---
esid: sec-json.stringify
description: >
Revoked proxy of array as replacer produces a TypeError
(honoring the realm of the current execution context).
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
4. If Type(replacer) is Object, then
a. If IsCallable(replacer) is true, then
i. Let ReplacerFunction be replacer.
b. Else,
i. Let isArray be ? IsArray(replacer).
IsArray ( argument )
[...]
3. If argument is a Proxy exotic object, then
a. If argument.[[ProxyHandler]] is null, throw a TypeError exception.
b. Let target be argument.[[ProxyTarget]].
c. Return ? IsArray(target).
features: [cross-realm, Proxy]
--- |
1034 |
replacer-array-proxy-revoked.js |
---
esid: sec-json.stringify
description: Revoked proxy value produces a TypeError.
info: |
[...]
4. If Type(replacer) is Object, then
a. If IsCallable(replacer) is true, then
i. Let ReplacerFunction be replacer.
b. Else,
i. Let isArray be ? IsArray(replacer).
7.2.2 IsArray
[...]
3. If argument is a Proxy exotic object, then
a. If the value of the [[ProxyHandler]] internal slot of argument is null,
throw a TypeError exception.
b. Let target be the value of the [[ProxyTarget]] internal slot of
argument.
c. Return ? IsArray(target).
features: [Proxy]
--- |
928 |
replacer-array-proxy.js |
---
esid: sec-json.stringify
description: >
Array proxy replacer serves as a filter of object keys.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
4. If Type(replacer) is Object, then
a. If IsCallable(replacer) is true, then
i. Let ReplacerFunction be replacer.
b. Else,
i. Let isArray be ? IsArray(replacer).
IsArray ( argument )
[...]
3. If argument is a Proxy exotic object, then
a. If argument.[[ProxyHandler]] is null, throw a TypeError exception.
b. Let target be argument.[[ProxyTarget]].
c. Return ? IsArray(target).
features: [Proxy]
--- |
969 |
replacer-array-string-object.js |
---
esid: sec-json.stringify
description: >
Converts String objects from replacer array to primitives using ToString.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
4. If Type(replacer) is Object, then
[...]
4. Repeat, while k < len,
a. Let v be ? Get(replacer, ! ToString(k)).
[...]
e. Else if Type(v) is Object, then
i. If v has a [[StringData]] or [[NumberData]] internal slot,
set item to ? ToString(v).
--- |
921 |
replacer-array-undefined.js |
---
esid: sec-json.stringify
description: >
Undefined values in replacer array are ignored.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
4. If Type(replacer) is Object, then
[...]
4. Repeat, while k < len,
a. Let v be ? Get(replacer, ! ToString(k)).
[...]
f. If item is not undefined and item is not currently an element of PropertyList, then
i. Append item to the end of PropertyList.
--- |
885 |
replacer-array-wrong-type.js |
---
esid: sec-json.stringify
description: >
Values that are neither strings nor numbers are ignored.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
4. If Type(replacer) is Object, then
[...]
4. Repeat, while k < len,
a. Let v be ? Get(replacer, ! ToString(k)).
[...]
f. If item is not undefined and item is not currently an element of PropertyList, then
i. Append item to the end of PropertyList.
features: [Proxy, Symbol]
--- |
943 |
replacer-function-abrupt.js |
---
esid: sec-serializejsonproperty
description: >
Abrupt completion from Call.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
4. If Type(replacer) is Object, then
a. If IsCallable(replacer) is true, then
i. Let ReplacerFunction be replacer.
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
3. If ReplacerFunction is not undefined, then
a. Set value to ? Call(ReplacerFunction, holder, « key, value »).
--- |
800 |
replacer-function-arguments.js |
---
esid: sec-serializejsonproperty
description: >
Replacer function is called with correct context and arguments.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
1. Let value be ? Get(holder, key).
[...]
3. If ReplacerFunction is not undefined, then
a. Set value to ? Call(ReplacerFunction, holder, « key, value »).
includes: [compareArray.js]
--- |
1400 |
replacer-function-array-circular.js |
---
esid: sec-serializejsonarray
description: >
Circular array value (returned from replacer function) throws a TypeError.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
3. If ReplacerFunction is not undefined, then
a. Set value to ? Call(ReplacerFunction, holder, « key, value »).
[...]
10. If Type(value) is Object and IsCallable(value) is false, then
a. Let isArray be ? IsArray(value).
b. If isArray is true, return ? SerializeJSONArray(value).
SerializeJSONArray ( value )
1. If stack contains value, throw a TypeError exception because the structure is cyclical.
--- |
1070 |
replacer-function-object-circular.js |
---
esid: sec-serializejsonobject
description: >
Circular object value (returned from replacer function) throws a TypeError.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
3. If ReplacerFunction is not undefined, then
a. Set value to ? Call(ReplacerFunction, holder, « key, value »).
[...]
10. If Type(value) is Object and IsCallable(value) is false, then
[...]
c. Return ? SerializeJSONObject(value).
SerializeJSONObject ( value )
1. If stack contains value, throw a TypeError exception because the structure is cyclical.
--- |
1255 |
replacer-function-object-deleted-property.js |
---
esid: sec-serializejsonproperty
description: >
Replacer function is called on properties, deleted during stringification.
info: |
SerializeJSONObject ( value )
[...]
5. If PropertyList is not undefined, then
[...]
6. Else,
a. Let K be ? EnumerableOwnPropertyNames(value, key).
[...]
8. For each element P of K, do
a. Let strP be ? SerializeJSONProperty(P, value).
[...]
SerializeJSONProperty ( key, holder )
1. Let value be ? Get(holder, key).
[...]
3. If ReplacerFunction is not undefined, then
a. Set value to ? Call(ReplacerFunction, holder, « key, value »).
--- |
1080 |
replacer-function-result-undefined.js |
---
esid: sec-serializejsonproperty
description: >
Result of replacer function is stringified.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
3. If ReplacerFunction is not undefined, then
a. Set value to ? Call(ReplacerFunction, holder, « key, value »).
--- |
1068 |
replacer-function-result.js |
---
esid: sec-serializejsonproperty
description: >
Result of replacer function is stringified.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
3. If ReplacerFunction is not undefined, then
a. Set value to ? Call(ReplacerFunction, holder, « key, value »).
--- |
1192 |
replacer-function-tojson.js |
---
esid: sec-serializejsonproperty
description: >
Replacer function is called on result of toJSON method.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
4. If Type(replacer) is Object, then
a. If IsCallable(replacer) is true, then
i. Let ReplacerFunction be replacer.
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
2. If Type(value) is Object, then
a. Let toJSON be ? Get(value, "toJSON").
b. If IsCallable(toJSON) is true, then
i. Set value to ? Call(toJSON, value, « key »).
3. If ReplacerFunction is not undefined, then
a. Set value to ? Call(ReplacerFunction, holder, « key, value »).
--- |
1339 |
replacer-function-wrapper.js |
---
esid: sec-json.stringify
description: >
Wrapper is plain extensible object with single data property.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
9. Let wrapper be ObjectCreate(%ObjectPrototype%).
10. Let status be CreateDataProperty(wrapper, the empty String, value).
includes: [propertyHelper.js]
--- |
1048 |
replacer-wrong-type.js |
---
esid: sec-json.stringify
description: >
Replacer paramter of wrong type is silently ignored.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
4. If Type(replacer) is Object, then
a. If IsCallable(replacer) is true, then
i. Set ReplacerFunction to replacer.
b. Else,
i. Let isArray be ? IsArray(replacer).
ii. If isArray is true, then
1. Set PropertyList to a new empty List.
features: [Symbol]
--- |
1102 |
shell.js |
---
description: |
Test if a given function is a constructor function.
defines: [isConstructor]
features: [Reflect.construct]
--- |
596 |
space-number-float.js |
---
esid: sec-json.stringify
description: >
Numeric space parameter is truncated to integer part.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
6. If Type(space) is Number, then
a. Set space to min(10, ! ToInteger(space)).
--- |
813 |
space-number-object.js |
---
esid: sec-json.stringify
description: >
Number objects are converted to primitives using ToNumber.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
5. If Type(space) is Object, then
a. If space has a [[NumberData]] internal slot, then
i. Set space to ? ToNumber(space).
--- |
1140 |
space-number-range.js |
---
esid: sec-json.stringify
description: >
Numeric space parameter is clamped to 0..10 range.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
6. If Type(space) is Number, then
a. Set space to min(10, ! ToInteger(space)).
b. If space < 1, let gap be the empty String; otherwise let gap be the
String value containing space occurrences of the code unit 0x0020 (SPACE).
--- |
863 |
space-number.js |
---
esid: sec-json.stringify
description: >
Numeric space parameter (integer in range 0..10) is equivalent
to string of spaces of that length.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
6. If Type(space) is Number, then
[...]
b. If space < 1, let gap be the empty String; otherwise let gap be the
String value containing space occurrences of the code unit 0x0020 (SPACE).
--- |
876 |
space-string-object.js |
---
esid: sec-json.stringify
description: >
String exotic objects are converted to primitives using ToString.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
5. If Type(space) is Object, then
[...]
b. Else if space has a [[StringData]] internal slot, then
i. Set space to ? ToString(space).
--- |
1186 |
space-string-range.js |
---
esid: sec-json.stringify
description: >
Only first 10 code units of string space parameter are used.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
7. Else if Type(space) is String, then
a. If the length of space is 10 or less, let gap be space; otherwise
let gap be the String value consisting of the first 10 code units of space.
--- |
758 |
space-string.js |
---
esid: sec-json.stringify
description: >
String space is used as gap.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
7. Else if Type(space) is String, then
a. If the length of space is 10 or less, let gap be space; otherwise
let gap be the String value consisting of the first 10 code units of space.
--- |
941 |
space-wrong-type.js |
---
esid: sec-json.stringify
description: >
Space parameter of wrong type is silently ignored.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
8. Else,
a. Let gap be the empty String.
features: [Symbol]
--- |
881 |
value-array-abrupt.js |
---
esid: sec-serializejsonarray
description: >
Abrupt completion from Get.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
10. If Type(value) is Object and IsCallable(value) is false, then
a. Let isArray be ? IsArray(value).
b. If isArray is true, return ? SerializeJSONArray(value).
SerializeJSONArray ( value )
[...]
6. Let len be ? LengthOfArrayLike(value).
features: [Proxy]
--- |
1454 |
value-array-circular.js |
---
esid: sec-serializejsonarray
description: >
Circular array value throws a TypeError.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
10. If Type(value) is Object and IsCallable(value) is false, then
a. Let isArray be ? IsArray(value).
b. If isArray is true, return ? SerializeJSONArray(value).
SerializeJSONArray ( value )
1. If stack contains value, throw a TypeError exception because the structure is cyclical.
--- |
963 |
value-array-proxy-revoked.js |
---
esid: sec-json.stringify
description: >
Revoked array proxy value produces a TypeError.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
10. If Type(value) is Object and IsCallable(value) is false, then
a. Let isArray be ? IsArray(value).
IsArray ( argument )
[...]
3. If argument is a Proxy exotic object, then
a. If argument.[[ProxyHandler]] is null, throw a TypeError exception.
features: [Proxy]
--- |
977 |
value-array-proxy.js |
---
esid: sec-serializejsonarray
description: >
Proxy of an array is treated as an array.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
10. If Type(value) is Object and IsCallable(value) is false, then
a. Let isArray be ? IsArray(value).
b. If isArray is true, return ? SerializeJSONArray(value).
SerializeJSONArray ( value )
[...]
6. Let len be ? LengthOfArrayLike(value).
7. Let index be 0.
8. Repeat, while index < len
a. Let strP be ? SerializeJSONProperty(! ToString(index), value).
features: [Proxy]
--- |
1326 |
value-bigint-cross-realm.js |
---
esid: sec-serializejsonproperty
description: JSON.stringify called with a BigInt object from another realm
features: [BigInt, cross-realm]
--- |
701 |
value-bigint-order.js |
---
description: BigInt stringify order of steps
esid: sec-serializejsonproperty
info: |
Runtime Semantics: SerializeJSONProperty ( key, holder )
2. If Type(value) is Object or BigInt, then
a. Let toJSON be ? GetGetV(value, "toJSON").
b. If IsCallable(toJSON) is true, then
i. Set value to ? Call(toJSON, value, « key »).
3. If ReplacerFunction is not undefined, then
a. Set value to ? Call(ReplacerFunction, holder, « key, value »).
4. If Type(value) is Object, then
[...]
d. Else if value has a [[BigIntData]] internal slot, then
i. Set value to value.[[BigIntData]].
[...]
10. If Type(value) is BigInt, throw a TypeError exception
features: [BigInt, arrow-function]
--- |
1325 |
value-bigint-replacer.js |
---
description: JSON serialization of BigInt values with replacer
esid: sec-serializejsonproperty
info: |
Runtime Semantics: SerializeJSONProperty ( key, holder )
3. If ReplacerFunction is not undefined, then
a. Set value to ? Call(ReplacerFunction, holder, « key, value »).
features: [BigInt]
--- |
712 |
value-bigint-tojson-receiver.js |
---
esid: sec-serializejsonproperty
description: toJSON method called with BigInt as receiver
features: [BigInt]
--- |
820 |
value-bigint-tojson.js |
---
description: BigInt toJSON method
esid: sec-serializejsonproperty
info: |
Runtime Semantics: SerializeJSONProperty ( key, holder )
2. If Type(value) is Object or BigInt, then
a. Let toJSON be ? GetGetV(value, "toJSON").
b. If IsCallable(toJSON) is true, then
i. Set value to ? Call(toJSON, value, « key »).
features: [BigInt]
--- |
626 |
value-bigint.js |
---
description: JSON serialization of BigInt values
esid: pending
features: [BigInt]
--- |
418 |
value-boolean-object.js |
---
esid: sec-serializejsonproperty
description: >
Boolean objects are converted to primitives using [[BooleanData]].
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
4. If Type(value) is Object, then
[...]
c. Else if value has a [[BooleanData]] internal slot, then
i. Set value to value.[[BooleanData]].
[...]
6. If value is true, return "true".
7. If value is false, return "false".
--- |
1022 |
value-function.js |
---
esid: sec-serializejsonproperty
description: >
Function values are ignored.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
10. If Type(value) is Object and IsCallable(value) is false, then
[...]
11. Return undefined.
--- |
718 |
value-number-negative-zero.js |
---
esid: sec-serializejsonproperty
description: >
Negative zero numbers are stringified to "0".
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
9. If Type(value) is Number, then
a. If value is finite, return ! ToString(value).
NumberToString ( m )
[...]
2. If m is +0 or -0, return the String "0".
--- |
779 |
value-number-non-finite.js |
---
esid: sec-serializejsonproperty
description: >
Non-finite numbers as serialized as null.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
4. If Type(value) is Object, then
a. If value has a [[NumberData]] internal slot, then
i. Set value to ? ToNumber(value).
[...]
9. If Type(value) is Number, then
a. If value is finite, return ! ToString(value).
b. Return "null".
--- |
867 |
value-number-object.js |
---
esid: sec-serializejsonproperty
description: >
Number objects are converted to primitives using ToNumber.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
4. If Type(value) is Object, then
a. If value has a [[NumberData]] internal slot, then
i. Set value to ? ToNumber(value).
[...]
9. If Type(value) is Number, then
a. If value is finite, return ! ToString(value).
--- |
1411 |
value-object-abrupt.js |
---
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).
--- |
584 |
value-object-circular.js |
---
esid: sec-serializejsonobject
description: >
Circular object value throws a TypeError.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
10. If Type(value) is Object and IsCallable(value) is false, then
[...]
c. Return ? SerializeJSONObject(value).
SerializeJSONObject ( value )
1. If stack contains value, throw a TypeError exception because the structure is cyclical.
--- |
974 |
value-object-proxy-revoked.js |
---
esid: sec-serializejsonobject
description: >
Revoked object proxy value produces a TypeError.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
10. If Type(value) is Object and IsCallable(value) is false, then
[...]
c. Return ? SerializeJSONObject(value).
SerializeJSONObject ( value )
[...]
6. Else,
a. Let K be ? EnumerableOwnPropertyNames(value, "key").
features: [Proxy]
--- |
959 |
value-object-proxy.js |
---
esid: sec-serializejsonobject
description: >
Proxy of an object is treated as regular object.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
10. If Type(value) is Object and IsCallable(value) is false, then
[...]
c. Return ? SerializeJSONObject(value).
SerializeJSONObject ( value )
[...]
6. Else,
a. Let K be ? EnumerableOwnPropertyNames(value, "key").
7. Let partial be a new empty List.
8. For each element P of K, do
a. Let strP be ? SerializeJSONProperty(P, value).
features: [Proxy]
--- |
1506 |
value-primitive-top-level.js |
---
esid: sec-serializejsonproperty
description: >
Top-level primitive values are stringified correctly.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
5. If value is null, return "null".
6. If value is true, return "true".
7. If value is false, return "false".
8. If Type(value) is String, return QuoteJSONString(value).
9. If Type(value) is Number, then
a. If value is finite, return ! ToString(value).
[...]
11. Return undefined.
--- |
1055 |
value-string-escape-ascii.js |
---
esid: sec-quotejsonstring
description: >
JSON.stringify property names and values containing ASCII
characters that require escaping
--- |
1757 |
value-string-escape-unicode.js |
---
esid: sec-quotejsonstring
description: >
JSON.stringify strings containing surrogate code units
features: [well-formed-json-stringify]
--- |
1798 |
value-string-object.js |
---
esid: sec-serializejsonproperty
description: >
String exotic objects are converted to primitives using ToString.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
4. If Type(value) is Object, then
[...]
b. Else if value has a [[StringData]] internal slot, then
i. Set value to ? ToString(value).
[...]
8. If Type(value) is String, return QuoteJSONString(value).
--- |
1420 |
value-symbol.js |
---
esid: sec-serializejsonproperty
description: >
Symbol primitives are ignored, both as keys and as values.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
11. Return undefined.
features: [Symbol]
--- |
756 |
value-tojson-abrupt.js |
---
esid: sec-serializejsonproperty
description: >
Abrupt completions from Get and Call.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
2. If Type(value) is Object, then
a. Let toJSON be ? Get(value, "toJSON").
b. If IsCallable(toJSON) is true, then
i. Set value to ? Call(toJSON, value, « key »).
--- |
872 |
value-tojson-arguments.js |
---
esid: sec-serializejsonproperty
description: >
toJSON is called with correct context and arguments.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
2. If Type(value) is Object, then
a. Let toJSON be ? Get(value, "toJSON").
b. If IsCallable(toJSON) is true, then
i. Set value to ? Call(toJSON, value, « key »).
--- |
1210 |
value-tojson-array-circular.js |
---
esid: sec-serializejsonarray
description: >
Circular array value (returned from toJSON method) throws a TypeError.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
2. If Type(value) is Object, then
a. Let toJSON be ? Get(value, "toJSON").
b. If IsCallable(toJSON) is true, then
i. Set value to ? Call(toJSON, value, « key »).
[...]
10. If Type(value) is Object and IsCallable(value) is false, then
a. Let isArray be ? IsArray(value).
b. If isArray is true, return ? SerializeJSONArray(value).
SerializeJSONArray ( value )
1. If stack contains value, throw a TypeError exception because the structure is cyclical.
--- |
1110 |
value-tojson-not-function.js |
---
esid: sec-serializejsonproperty
description: >
toJSON value is not callable.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
2. If Type(value) is Object, then
a. Let toJSON be ? Get(value, "toJSON").
b. If IsCallable(toJSON) is true, then
i. Set value to ? Call(toJSON, value, « key »).
--- |
883 |
value-tojson-object-circular.js |
---
esid: sec-serializejsonobject
description: >
Circular object value (returned from toJSON method) throws a TypeError.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
2. If Type(value) is Object, then
a. Let toJSON be ? Get(value, "toJSON").
b. If IsCallable(toJSON) is true, then
i. Set value to ? Call(toJSON, value, « key »).
[...]
10. If Type(value) is Object and IsCallable(value) is false, then
[...]
c. Return ? SerializeJSONObject(value).
SerializeJSONObject ( value )
1. If stack contains value, throw a TypeError exception because the structure is cyclical.
--- |
1072 |
value-tojson-result.js |
---
esid: sec-serializejsonproperty
description: >
Result of toJSON method is stringified.
info: |
JSON.stringify ( value [ , replacer [ , space ] ] )
[...]
12. Return ? SerializeJSONProperty(the empty String, wrapper).
SerializeJSONProperty ( key, holder )
[...]
2. If Type(value) is Object, then
a. Let toJSON be ? Get(value, "toJSON").
b. If IsCallable(toJSON) is true, then
i. Set value to ? Call(toJSON, value, « key »).
--- |
1083 |