fix(javascript): preserve lexical binding and default export capture semantics

Resolve CommonJS wrapper bindings from the parser-owned source type. Capture default identifier export values at the export statement while preserving live named bindings.

Refs: #3261, #3297

Co-authored-by: hhang <169027046+xu91102@users.noreply.github.com>
This commit is contained in:
morluto
2026-10-14 17:49:13 +08:00
parent 322506d0c0
commit dae1e55381
6 changed files with 111 additions and 16 deletions
@@ -687,6 +687,7 @@ const createState = (
moduleLinks: [],
linkedRequireCalls: new WeakSet(),
moduleLinkBindings: new WeakMap(),
defaultExportExpressions: new WeakMap(),
conditionallySkippedExpressions: new WeakSet(),
requiredModuleEffects: new Map(),
ambientBindingWrites: new Map(),