Skip to content

Commit a014b7f

Browse files
committed
JavaScript parser: fix parsing of labels
Identifiers such as 'of' and 'async' are valid labels. Fixes #1440.
1 parent 8ba6297 commit a014b7f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Compiler: jsoo link archive with -a (#1428)
44

55
## Bug fixes
6+
* Compiler (js parser): fix parsing of js labels (fix #1440)
67

78
# 5.1.1 (2023-03-15) - Lille
89
## Bug fixes

compiler/lib/js_parser.mly

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,7 @@ stmt1:
509509
| debugger_stmt { $1 }
510510

511511
label:
512-
| T_IDENTIFIER {
513-
let name, _raw = $1 in
514-
Label.of_string name }
512+
| id { Label.of_string $1 }
515513

516514
(* Library definitions *)
517515

0 commit comments

Comments
 (0)