You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a combination of all the above success cases nested
For paths in InternalizeJSONProperty, and the interaction with JSON.stringify, test with a reviver that modifies the holder object, as mentioned in tc39 issue 39:
[array and plain object] overwrite of not-yet-processed entry should result in absence of source for that entry
primitive to non-primitive
non-primitive to primitive
non-primitive to a clone (same date but different identity)
primitive to a different primitive
[array and plain object] overwrite and restoration of not-yet-processed entry should preserve source for that entry
primitive
non-primitive
[array] splicing out an item should result in absence of source from the affected index forward
...but restoring items at their original index should preserve source
Test the overall intended functionality with examples from the proposal README and slides (linked in README).
Test that reviver function is applied to the source, not the parsed value, by roundtripping:
I removed "Brand check for this method" - JSON.isRawJSON and JSON.rawJSON are static methods, so there's no instance to brand-check.
Here is one more suggestion: On the return value of JSON.rawJSON(), the rawJSON property cannot be modified or deleted and has the correct property descriptor.
Proposal README
Proposal rendered spec
For testing the tests, the proposal is shipped in v8.
JSON.isRawJSON
:JSON.rawJSON
.[[IsRawJSON]]
internal slot:{}
,[]
.null
,undefinded
, a Boolean, a symbol, a number.JSON.rawJSON
:true
,false
,null
rawJSON
own property)SyntaxError
in case of:{}
.[1]
.TypeError
when trying to extend a rawJSON result object.JSON.parse
, each test should have a callablereviver
argument:CreateJSONParseRecord
, only success cases (normal output), a test for each branch:InternalizeJSONProperty
, and the interaction withJSON.stringify
, test with areviver
that modifies the holder object, as mentioned in tc39 issue 39:JSON.parse(" 9999999999999999", (key, val) => BigInt(val)) // → 9999999999999999n
The text was updated successfully, but these errors were encountered: