@@ -200,7 +200,7 @@ let g_exc: { g: Isolate, l: StackFrame[], d: number } | null = null
200
200
const kTokenNames = Build . NDEBUG ? [ ] as never
201
201
: ( "block, blockEnd, semiColon, prefix, action, group, dict, array, groupEnd, comma, question, colon, fn, assign"
202
202
+ ", or, and, bitOr, bitXor, bitAnd, compare1, compare2, bitMove, math1, math2, math3"
203
- + ", unary, rightUnary, callOrAccess, dot, ref, literal " ) . split ( ", " )
203
+ + ", unary, rightUnary, callOrAccess, dot, literal, ref " ) . split ( ", " )
204
204
const kOpNames = Build . NDEBUG ? [ ] as never
205
205
: "block,stats,stat,comma,pair,fn,assign,ifElse,binary,unary,call,access,composed,literal,ref,fnDesc" . split ( "," )
206
206
@@ -213,7 +213,7 @@ const kLabelled = "labelled", kProto = "__proto__", kDots = "..."
213
213
//#region helper functions
214
214
215
215
const Op = ( ( o : O , q : unknown , x : unknown , y : unknown ) : BaseOp < O > => {
216
- return ( NDEBUG ? { o, q, x, y } : { n : o === O . composed ? q === "{"
216
+ return ( NDEBUG ? { o, q, x, y } : { n : o === O . composed ? x as OpValues [ O . composed ] [ "x" ] === "{"
217
217
? "dict" : "array" : kOpNames [ o ] , q, x, y, o } ) as BaseOp < O >
218
218
} ) as {
219
219
< O extends Exclude < keyof OpValues , O . stat | O . literal > > (
@@ -645,7 +645,11 @@ const parseTree = (tokens_: readonly Token[], inNewFunc: boolean | null | undefi
645
645
ctx_ . push ( cur ) , topIsDict = false
646
646
} else {
647
647
type = T . groupEnd , Build . NDEBUG || ( ( cur as OverriddenToken ) . w = Token ( T . groupEnd , ")" ) )
648
- "case default" . includes ( ctx_ [ ctx_ . length - 1 ] . v ) && values_ . push ( Op ( O . literal , L . plain , null , null ) )
648
+ const prefix = ctx_ [ ctx_ . length - 1 ] . v
649
+ if ( prefix === "case" || prefix === "default" ) {
650
+ values_ . push ( Op ( O . literal , L . plain , null , null ) )
651
+ consume ( )
652
+ }
649
653
}
650
654
continue
651
655
case T . fn : /* T.fn: */
0 commit comments