Repository navigation
fix(wave-1): ECMA-404 JSON.parse, process exit/rejections, worker Date/exit, CLI flags (v0.10.9) - #65
Merged
Merged
Conversation
…e/exit, CLI flags (v0.10.9)
This was referenced Nov 11, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary (Wave 1 —
v0.10.9)Closes the Wave 1 issues covering ECMA-404
JSON.parseconformance & performance,processlifecycle & unhandled rejection/uncaught exception handling,worker_threadsDate&process.exitsemantics, and standard CLI flags.JSON.parsereturns incorrectly rounded numbers and rejects valid JSON (1e400, lone-surrogate escapes, nesting > 128) #47process.exit(n)is reported as an uncaught error,process.exitCode/'exit'are ignored, async errors exit 0 #48process.stdinnever delivers piped input andprocess.argvdoes not contain script arguments #49node:worker_threads:process.exit(code)in a worker raises'error'; aDatearrives as a string throughpostMessage#57JSON.parseis 4.5–7.7× and object construction 14–47× slower than Node / Bun / Deno in a hot loop (follow-up to #37) #61slice run <dir>re-bundles on every invocation (SvelteKit workload: 160 ms vs Node 117 ms, Deno 70 ms, Bun 56 ms) #631. Iterative ECMA-404
JSON.parseEngine (#47,#61)serde_json::Deserializer(try_fast_parse_json_str) fast-path andboa_parser+ByteCompilerreviver fallback invendor/boa_engine/src/builtins/json/mod.rswith a direct iterative ECMA-404 state-machine parser (Json::parse_ecma404) overJsStrVariant::Latin1(&[u8])andJsStrVariant::Utf16(&[u16]).fast_float2::parse::<f64, _>for exact round-to-nearest-evenf64conversion (9007199254740993.0 === 9007199254740992,1e23, subnormals), unboxed 15-digit exact integer accumulation,-0.0preservation, and±Infinityon exponent overflow (1e400,-1e400).\ud800,\udfff) in bothJSON.parseandJSON.stringify(try_fast_stringify), zero-copy slices unescaped strings, and chunks Latin-1 escaped strings viaextend_from_sliceinto a 1-byteJsStr::latin1buffer.MAX_DEPTH = 2048), Direct Slot Insertion &revivercontext.source: Uses an explicit heap-allocatedVec<ContainerFrame>stack (O(1)C/Rust call stack) supporting up to2048nesting levels, directPropertyMap::insert_data_propertyslot insertion on fresh objects, and primitive source-span tracking forrevivercontext.source.2. Process Lifecycle, Exit Codes, Unhandled Rejections & Uncaught Exceptions (
#48)__slice_process_exit(code)native host binding returning an uncatchablePanicError(is_catchable() == false) soprocess.exit(code)immediately unwinds pasttry / catch, Promise reactions, microtasks, and timers.SliceHostHooks::promise_rejection_trackeronboa_engine::Contextto track rejected Promises (Track/Handled). Unhandled rejections after microtask draining either dispatchprocess.emit('unhandledRejection', reason, promise)or fail withUncaught (in promise) <reason>and exit code1.process.on('beforeExit'),process.on('exit'),process.on('uncaughtException'),process.on('uncaughtExceptionMonitor'), andprocess.exitCodepropagation gated behind aDIRTY_PROCESSbitmask for zero overhead whenprocessis untouched.3.
worker_threadsDateSerialization &process.exit(code)(#57)process.exitoverride in18_intl.jsso workers callingprocess.exit(code)(even whenprocessis referenced) invoke__slice_process_exit(code), immediately notifyingworker_self_set_listening(false, Some(code))and propagatingchild_isolate.last_exit_code()toworker.on('exit', code).__serReplacer/__serReviverin09_workers.jsto checkthis[k] instanceof Dateprior toDate.prototype.toJSONcoercion (preservingDateinstances,Invalid Date,NaN, and±InfinityacrossworkerData,postMessage, andMessageChannel).4. CLI Ergonomics (
#49,#63)-e/--eval,-p/--print,-c/--check(slice check),-v/-V/--version, stdin (-and piped stdin),process.argvscript argument forwarding, and non-zero process exit code propagation.