-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Describe the bug
input.js is expected to be terminated without error but the transpiled code throws ReferenceError.
Input code
"use strict";
switch ( 0 ) { case 0 ?? 0 : }Config
No response
Playground link
Expected behavior
The input code terminates without error:
$ node input.js
// terminates without errorActual behavior
The transpiled code throws ReferenceError:
$ node output.js
output.js:3
case (ref = 0) !== null && ref !== void 0 ? ref : 0:
^
ReferenceError: ref is not defined
at Object.<anonymous> (/Users/p51lee/dev/esmeta-plrg/output.js:3:15)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
Node.js v18.11.0Version
1.3.11 (default SWC playground)
Additional context
No response