8000 accept string literal as case labels · repos-javascript-compilers/JSX@5b40c15 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b40c15

Browse files
committed
accept string literal as case labels
1 parent e67df03 commit 5b40c15

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/parser.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,8 @@ var Parser = exports.Parser = Class.extend({
667667
if (! (labelExpr instanceof NullExpression
668668
|| labelExpr instanceof BooleanLiteralExpression
669669
|| labelExpr instanceof IntegerLiteralExpression
670-
|| labelExpr instanceof NumberLiteralExpression)) {
670+
|| labelExpr instanceof NumberLiteralExpression
671+
|| labelExpr instanceof StringLiteralExpression)) {
671672
this._newError("case label is not a constant");
672673
return false;
673674
}

0 commit comments

Comments
 (0)
0