Closed
Description
Let's have this example,
print(JSON.stringify(JSON.parse("[1, 2]", function (name, value, context) {
if (name === "0")
this[1] = [ "Hello" ];
return this[name];
})));
JSON.stringify
's result is [1,["Hello",["Hello"]]]
before this proposal because reviver modified array[1]
at runtime and we visit this newly inserted ["Hello"]
array.
But for this array, we do not have correct corresponding parse information since this is not coming from text. source information for this property is still 2
's information.
Thus,
i. Assert: typedValNode is an ArrayLiteral.
This will crash since this newly inserted array does not have right source information. Source information for this property says 2
(it is coming from the original source).
Metadata
Metadata
Assignees
Labels
No labels