From 408c63baa2cf0207bb355c03e7836a1e8469b051 Mon Sep 17 00:00:00 2001 From: Malte Ubl Date: Sun, 18 Oct 2026 17:58:04 -0700 Subject: [PATCH] Declare the new runtime features in the scanner's literal order JSON.stringify of the runtime-features record follows the declared field order in the self-hosted compiler and the literal's insertion order under Node. warningReplace and stdioExtended were declared before processEvents but built after it, so the two compilers serialized the record differently (self-hosting-runtime-features). The interface now lists them in the literal's order. Co-Authored-By: Claude Opus 5.5 --- packages/compiler/src/ir/runtime-features.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/compiler/src/ir/runtime-features.ts b/packages/compiler/src/ir/runtime-features.ts index 1bda9c64b8..d337546bd1 100644 --- a/packages/compiler/src/ir/runtime-features.ts +++ b/packages/compiler/src/ir/runtime-features.ts @@ -16,11 +16,13 @@ export interface RuntimeFeatures { fileHandle: boolean; fetch: boolean; eventTarget: boolean; - /** process.emitWarning is assigned (process.setEmitWarning). */ + processEvents: boolean; + /** process.emitWarning is assigned (process.setEmitWarning). Declared + * in the literal's order: JSON.stringify of the features record must + * match between the Node-run and self-hosted compilers. */ warningReplace: boolean; /** stdin setEncoding / string data listeners / stdio 'resize' events. */ stdioExtended: boolean; - processEvents: boolean; emitter: boolean; stream: boolean; zlib: boolean;