Skip to content

fix(parser): treat escaped class modifiers as property names - #642

Merged
CPunisher merged 1 commit into
mainfrom
fix/escaped-static-asi
Sep 14, 2026
Merged

CPunisher merged 1 commit into
mainfrom
fix/escaped-static-asi

Conversation

@magic-akari

@magic-akari magic-akari commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

Leave escaped contextual keywords to class element name parsing so ASI can separate them from following members. Only recognize an unescaped static keyword as the start of a static block.

Cover field names and static flags, including escaped get, set, async, and static spellings and TypeScript class fields.

Leave escaped contextual keywords to class element name parsing so ASI can separate them from following members. Only recognize an unescaped static keyword as the start of a static block.

Cover field names and static flags, including escaped get, set, async, and static spellings and TypeScript class fields.

Related tests: tc39/test262#5134
Related V8 fix: https://chromium-review.googlesource.com/c/v8/v8/+/8403169
@github-actions

Copy link
Copy Markdown

Gungraun benchmark diff

Values are shown as merge | base.

Download the raw Gungraun and Valgrind data (retained for 90 days).

Callgrind metric changes

Callgrind instruction counts (Ir) and CodSpeed throughput cycle estimates (Ct) for the merge and base revisions. Values are shown as merge / base in K (1,000), truncated to whole thousands; Ct is converted from centi-cycles to cycles first. Multi-part profiles use the part numbers from Gungraun and include an aggregated Total. New and Removed identify benchmarks that exist on only one side; the missing value is shown as a dash. Percentages are rounded to at most three decimal places. Lower is better: 🟢 improvement, 🔴 regression, ⚪ unchanged.

Codegen
Benchmark Ir (K) Change Ct (K) Change
cal_com_tsx 21,938 / 21,938 0% ⚪ 11,461 / 11,461 0% ⚪
typescript 182,311 / 182,311 0% ⚪ 94,727 / 94,727 0% ⚪
Parser
Benchmark Ir (K) Change Ct (K) Change
angular 15,337 / 15,337 0% ⚪ 8,132 / 8,132 0% ⚪
backbone 2,033 / 2,033 0% ⚪ 1,046 / 1,046 0% ⚪
cal_com_tsx 46,532 / 46,532 0% ⚪ 23,647 / 23,647 0% ⚪
jquery 10,604 / 10,604 0% ⚪ 5,493 / 5,493 0% ⚪
jquery_mobile 17,373 / 17,373 0% ⚪ 9,064 / 9,064 0% ⚪
mootools 8,855 / 8,855 0% ⚪ 4,831 / 4,831 0% ⚪
three 53,748 / 53,765 −0.032% 🟢 28,048 / 28,058 −0.035% 🟢
typescript 276,386 / 276,390 −0.001% 🟢 140,585 / 140,587 −0.001% 🟢
underscore 1,745 / 1,745 0% ⚪ 899 / 899 0% ⚪
yui 9,281 / 9,281 0% ⚪ 4,784 / 4,784 0% ⚪
Resolver
Benchmark Ir (K) Change Ct (K) Change
typescript 116,646 / 116,646 0% ⚪ 77,441 / 77,441 0% ⚪
Semantic
Benchmark Ir (K) Change Ct (K) Change
analyze/cal_com_tsx 16,530 / 16,530 0% ⚪ 11,979 / 11,979 0% ⚪
analyze/typescript 155,096 / 155,096 0% ⚪ 104,462 / 104,462 0% ⚪
syntax_check/cal_com_tsx 29,408 / 29,408 0% ⚪ 19,935 / 19,935 0% ⚪
syntax_check/typescript 191,737 / 191,737 0% ⚪ 124,428 / 124,428 0% ⚪
Type strip
Benchmark Ir (K) Change Ct (K) Change
astro_config/Part 1 1,634 / 1,634 0% ⚪ 937 / 937 0% ⚪
astro_config/Part 2 192 / 192 0% ⚪ 97 / 97 0% ⚪
astro_config/Total 1,826 / 1,826 0% ⚪ 1,034 / 1,034 0% ⚪
effect_schema_ast/Part 1 5,751 / 5,753 −0.046% 🟢 3,014 / 3,016 −0.051% 🟢
effect_schema_ast/Part 2 828 / 828 0% ⚪ 447 / 447 0% ⚪
effect_schema_ast/Total 6,579 / 6,582 −0.04% 🟢 3,462 / 3,463 −0.044% 🟢
hono_types/Part 1 6,239 / 6,239 −0.001% 🟢 3,378 / 3,378 −0.001% 🟢
hono_types/Part 2 132 / 132 0% ⚪ 67 / 67 0% ⚪
hono_types/Total 6,371 / 6,372 −0.001% 🟢 3,445 / 3,445 −0.001% 🟢
Visit
Benchmark Ir (K) Change Ct (K) Change
traverse/cal_com_tsx 5,636 / 5,636 0% ⚪ 3,144 / 3,144 0% ⚪
traverse/typescript 42,174 / 42,174 0% ⚪ 23,587 / 23,587 0% ⚪
visit/cal_com_tsx 2,985 / 2,985 0% ⚪ 1,704 / 1,704 0% ⚪
visit/typescript 25,768 / 25,768 0% ⚪ 14,786 / 14,786 0% ⚪
visit_mut/cal_com_tsx 2,845 / 2,845 0% ⚪ 1,578 / 1,578 0% ⚪
visit_mut/typescript 24,742 / 24,742 0% ⚪ 13,594 / 13,594 0% ⚪
Benchmark results
gungraun::parser::bench_parser angular:(ANGULAR, Lang :: Js)
  Baselines:                               |base
  Instructions:                    15337881|15337881             (No change)
  Throughput Cycles:              813291742|813291742            (No change)
gungraun::parser::bench_parser backbone:(BACKBONE, Lang :: Js)
  Baselines:                               |base
  Instructions:                     2033774|2033774              (No change)
  Throughput Cycles:              104688475|104688475            (No change)
gungraun::parser::bench_parser jquery:(JQUERY, Lang :: Js)
  Baselines:                               |base
  Instructions:                    10604279|10604279             (No change)
  Throughput Cycles:              549337664|549337664            (No change)
gungraun::parser::bench_parser jquery_mobile:(JQUERY_MOBILE, Lang :: Js)
  Baselines:                               |base
  Instructions:                    17373078|17373078             (No change)
  Throughput Cycles:              906475424|906475424            (No change)
gungraun::parser::bench_parser mootools:(MOOTOOLS, Lang :: Js)
  Baselines:                               |base
  Instructions:                     8855460|8855460              (No change)
  Throughput Cycles:              483136098|483136098            (No change)
gungraun::parser::bench_parser underscore:(UNDERSCORE, Lang :: Js)
  Baselines:                               |base
  Instructions:                     1745646|1745646              (No change)
  Throughput Cycles:               89937401|89937401             (No change)
gungraun::parser::bench_parser three:(THREE, Lang :: Js)
  Baselines:                               |base
  Instructions:                    53748055|53765220             (-0.03193%) [-1.00032x]
  Throughput Cycles:             2804842050|2805827725           (-0.03513%) [-1.00035x]
gungraun::parser::bench_parser yui:(YUI, Lang :: Js)
  Baselines:                               |base
  Instructions:                     9281501|9281501              (No change)
  Throughput Cycles:              478404009|478404009            (No change)
gungraun::parser::bench_parser typescript:(TYPESCRIPT, Lang :: Js)
  Baselines:                               |base
  Instructions:                   276386624|276390341            (-0.00134%) [-1.00001x]
  Throughput Cycles:            14058539152|14058748434          (-0.00149%) [-1.00001x]
gungraun::parser::bench_parser cal_com_tsx:(CAL_COM_TSX, Lang :: Tsx)
  Baselines:                               |base
  Instructions:                    46532668|46532707             (-0.00008%) [-1.00000x]
  Throughput Cycles:             2364762119|2364764103           (-0.00008%) [-1.00000x]
gungraun::semantic::bench_analyze typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                               |base
  Instructions:                   155096068|155096068            (No change)
  Throughput Cycles:            10446230031|10446230031          (No change)
gungraun::semantic::bench_analyze cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                               |base
  Instructions:                    16530567|16530567             (No change)
  Throughput Cycles:             1197999542|1197999542           (No change)
gungraun::semantic::bench_syntax_check typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                               |base
  Instructions:                   191737804|191737804            (No change)
  Throughput Cycles:            12442854953|12442854953          (No change)
gungraun::semantic::bench_syntax_check cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                               |base
  Instructions:                    29408166|29408166             (No change)
  Throughput Cycles:             1993572428|1993572428           (No change)
gungraun::resolver::bench_resolver typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                               |base
  Instructions:                   116646094|116646094            (No change)
  Throughput Cycles:             7744132500|7744132500           (No change)
gungraun::codegen::bench_codegen typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                               |base
  Instructions:                   182311645|182311645            (No change)
  Throughput Cycles:             9472721967|9472721967           (No change)
gungraun::codegen::bench_codegen cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                               |base
  Instructions:                    21938378|21938378             (No change)
  Throughput Cycles:             1146129945|1146129945           (No change)
gungraun::type_strip::bench_type_strip astro_config:(ASTRO_CONFIG, type_strip_options(Lang :: Ts))
  ## pid: 8423 thread: 8423 part: 1        |pid: 8322 thread: 8322 part: 1
  Command:             target/release/deps/gungraun-e52e4567245f12c0
  Baselines:                               |base
  Instructions:                     1634418|1634418              (No change)
  Throughput Cycles:               93715599|93715599             (No change)
  ## pid: 8423 thread: 8423 part: 2        |pid: 8322 thread: 8322 part: 2
  Command:             target/release/deps/gungraun-e52e4567245f12c0
  Instructions:                      192540|192540               (No change)
  Throughput Cycles:                9740079|9740079              (No change)
  ## Total
  Instructions:                     1826958|1826958              (No change)
  Throughput Cycles:              103455678|103455678            (No change)
gungraun::type_strip::bench_type_strip effect_schema_ast:(EFFECT_SCHEMA_AST, type_strip_options(Lang :: Ts)...
  ## pid: 8424 thread: 8424 part: 1        |pid: 8323 thread: 8323 part: 1
  Command:             target/release/deps/gungraun-e52e4567245f12c0
  Baselines:                               |base
  Instructions:                     5751156|5753796              (-0.04588%) [-1.00046x]
  Throughput Cycles:              301467785|301620666            (-0.05069%) [-1.00051x]
  ## pid: 8424 thread: 8424 part: 2        |pid: 8323 thread: 8323 part: 2
  Command:             target/release/deps/gungraun-e52e4567245f12c0
  Instructions:                      828687|828687               (No change)
  Throughput Cycles:               44750742|44750742             (No change)
  ## Total
  Instructions:                     6579843|6582483              (-0.04011%) [-1.00040x]
  Throughput Cycles:              346218527|346371408            (-0.04414%) [-1.00044x]
gungraun::type_strip::bench_type_strip hono_types:(HONO_TYPES, type_strip_options(Lang :: Ts))
  ## pid: 8425 thread: 8425 part: 1        |pid: 8324 thread: 8324 part: 1
  Command:             target/release/deps/gungraun-e52e4567245f12c0
  Baselines:                               |base
  Instructions:                     6239198|6239272              (-0.00119%) [-1.00001x]
  Throughput Cycles:              337805728|337809595            (-0.00114%) [-1.00001x]
  ## pid: 8425 thread: 8425 part: 2        |pid: 8324 thread: 8324 part: 2
  Command:             target/release/deps/gungraun-e52e4567245f12c0
  Instructions:                      132771|132771               (No change)
  Throughput Cycles:                6733019|6733019              (No change)
  ## Total
  Instructions:                     6371969|6372043              (-0.00116%) [-1.00001x]
  Throughput Cycles:              344538747|344542614            (-0.00112%) [-1.00001x]
gungraun::visit::bench_visit typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                               |base
  Instructions:                    25768742|25768742             (No change)
  Throughput Cycles:             1478626950|1478626950           (No change)
gungraun::visit::bench_visit cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                               |base
  Instructions:                     2985807|2985807              (No change)
  Throughput Cycles:              170401114|170401114            (No change)
gungraun::visit::bench_visit_mut typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                               |base
  Instructions:                    24742919|24742919             (No change)
  Throughput Cycles:             1359406287|1359406287           (No change)
gungraun::visit::bench_visit_mut cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                               |base
  Instructions:                     2845475|2845475              (No change)
  Throughput Cycles:              157817693|157817693            (No change)
gungraun::visit::bench_traverse typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                               |base
  Instructions:                    42174180|42174180             (No change)
  Throughput Cycles:             2358709963|2358709963           (No change)
gungraun::visit::bench_traverse cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                               |base
  Instructions:                     5636127|5636127              (No change)
  Throughput Cycles:              314496247|314496247            (No change)

Gungraun result: Ok. 26 without regressions; 0 regressed; 0 filtered; 26 benchmarks finished in 37.6739s

@magic-akari
magic-akari marked this pull request as ready for review September 13, 2026 18:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-13T18:53:27.650259Z 1a88232 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@CPunisher
CPunisher merged commit 2eeb3e8 into main Sep 14, 2026
18 checks passed
@CPunisher
CPunisher deleted the fix/escaped-static-asi branch September 14, 2026 05:21
@swc-project-bot swc-project-bot Bot mentioned this pull request Sep 14, 2026
Soon (SoonIter) pushed a commit that referenced this pull request Sep 14, 2026
## [0.2.1] - 2026-09-14

### 🐛 Bug Fixes

- *(parser)* Respect line breaks before import assertions (#628)
- *(parser)* Diagnose function bodies in ambient contexts (#631)
- *(parser)* Unify in operator grammar context handling (#637)
- *(ast)* Seal AST storage traits (#638)
- *(parser)* Treat escaped class modifiers as property names (#642)

### 🚜 Refactor

- *(ast)* Simplify flattened AST extra data design (#622)
- *(bridge)* Centralize N-API dependencies (#639)
- Consolidate Wasm build and packaging tooling (#640)

### 📚 Documentation

- Align pull request template and creator guidance (#641)

### ⚙️ Miscellaneous Tasks

- Ignore local development metadata (#632)
- *(build)* Strip symbols from release binaries (#630)
- *(ci)* Use the default test profile (#633)
- *(ci)* Simplify Gungraun table formatting (#634)

Co-authored-by: swc-project-bot[bot] <316843836+swc-project-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants