Files
rust_browser/tests/external/js262/expected/json-stringify-basic.txt
Zachary D. Rowitsch 0c21feb090
Some checks failed
ci / fast (linux) (push) Failing after 11m14s
Implement JSON.stringify and JSON.parse with full spec compliance
Add the JSON global object with both methods following the sentinel
NativeFunction + interpreter interception pattern. The implementation
includes a dedicated recursive descent JSON parser (strict spec: no
trailing commas, no single quotes, no hex/octal, surrogate pair support),
JSON.stringify with replacer function/array, space indentation, toJSON,
boxed primitive unwrapping, and circular reference detection via ptr_eq.

Safety: depth-limited to 512 levels for both parse and stringify to
prevent stack overflow from malicious input. Space string truncation
uses char boundaries to avoid panics on multi-byte UTF-8.

138 unit tests, 2 conformance tests (js262).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 17:00:47 -05:00

18 lines
106 B
Plaintext

null
true
false
42
"hello"
{}
[]
[1,2,3]
{"a":{"b":[1,2]}}
null
null
[1,null,3]
1
two
true
true
undefined