You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/parse.js
+25-16Lines changed: 25 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -44,10 +44,10 @@
44
44
45
45
"use strict";
46
46
47
-
varKEYWORDS="break case catch class const continue debugger default delete do else extends finally for function if in instanceof let new return switch throw try typeof var void while with";
47
+
varKEYWORDS="break case catch class const continue debugger default delete do else extends finally for function if in instanceof new return switch throw try typeof var void while with";
48
48
varKEYWORDS_ATOM="false null true";
49
49
varRESERVED_WORDS=[
50
-
"abstract async await boolean byte char double enum export final float goto implements import int interface long native package private protected public short static super synchronized this throws transient volatile yield",
50
+
"abstract async await boolean byte char double enum export final float goto implements import int interface let long native package private protected public short static super synchronized this throws transient volatile yield",
51
51
KEYWORDS_ATOM,
52
52
KEYWORDS,
53
53
].join(" ");
@@ -867,6 +867,15 @@ function parse($TEXT, options) {
867
867
next();
868
868
returnimport_();
869
869
}
870
+
break;
871
+
case"let":
872
+
if(is_vardefs()){
873
+
next();
874
+
varnode=let_();
875
+
semicolon();
876
+
returnnode;
877
+
}
878
+
break;
870
879
case"yield":
871
880
if(S.in_generator)returnsimple_statement();
872
881
break;
@@ -952,12 +961,6 @@ function parse($TEXT, options) {
952
961
next();
953
962
returnif_();
954
963
955
-
case"let":
956
-
next();
957
-
varnode=let_();
958
-
semicolon();
959
-
returnnode;
960
-
961
964
case"return":
962
965
if(S.in_function==0&&!options.bare_returns)
963
966
croak("'return' outside of function");
@@ -1197,7 +1200,7 @@ function parse($TEXT, options) {
1197
1200
if(await||!is("punc",";")){
1198
1201
init=is("keyword","const")
1199
1202
? (next(),const_(true))
1200
-
: is("keyword","let")
1203
+
: is("name","let")&&is_vardefs()
1201
1204
? (next(),let_(true))
1202
1205
: is("keyword","var")
1203
1206
? (next(),var_(true))
@@ -1540,12 +1543,18 @@ function parse($TEXT, options) {
0 commit comments