Files
rust_browser/tests/external/js262/expected/json-parse-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

16 lines
57 B
Plaintext

true
true
false
42
-2.75
hello
1
two
3
1
3
1
true
null
z