Open ioannad opened 5 months ago
I hope I didn't miss important test cases, and that the plan is not too much or too little. Any comments are very welcome!
I make the start by migrating the staging tests by the v8 project authors.
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