Skip to content

Commit e3d70e0

Browse files
committed
Relates to #892, update esprima to 2.7.2
1 parent fe3d321 commit e3d70e0

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

build/jslib/esprima.js

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,7 @@
11361136
}
11371137

11381138
if (quote !== '') {
1139+
index = start;
11391140
throwUnexpectedToken();
11401141
}
11411142

@@ -2728,7 +2729,7 @@
27282729

27292730
return node.finishProperty(
27302731
'init', key, false,
2731-
new WrappingNode(keyToken).finishAssignmentPattern(key, init), false, false);
2732+
new WrappingNode(keyToken).finishAssignmentPattern(key, init), false, true);
27322733
} else if (!match(':')) {
27332734
params.push(keyToken);
27342735
return node.finishProperty('init', key, false, key, false, true);
@@ -3263,6 +3264,9 @@
32633264
if (!strict && state.allowYield && matchKeyword('yield')) {
32643265
return parseNonComputedProperty();
32653266
}
3267+
if (!strict && matchKeyword('let')) {
3268+
return node.finishIdentifier(lex().value);
3269+
}
32663270
isAssignmentTarget = isBindingElement = false;
32673271
if (matchKeyword('function')) {
32683272
return parseFunctionExpression();
@@ -3274,9 +3278,6 @@
32743278
if (matchKeyword('class')) {
32753279
return parseClassExpression();
32763280
}
3277-
if (!strict && matchKeyword('let')) {
3278-
return node.finishIdentifier(lex().value);
3279-
}
32803281
throwUnexpectedToken(lex());
32813282
} else if (type === Token.BooleanLiteral) {
32823283
isAssignmentTarget = isBindingElement = false;
@@ -3854,6 +3855,7 @@
38543855

38553856
argument = null;
38563857
expr = new Node();
3858+
delegate = false;
38573859

38583860
expectKeyword('yield');
38593861

@@ -4059,15 +4061,15 @@
40594061
}
40604062

40614063
function parseVariableDeclarationList(options) {
4062-
var list = [];
4064+
var opt, list;
40634065

4064-
do {
4065-
list.push(parseVariableDeclaration({ inFor: options.inFor }));
4066-
if (!match(',')) {
4067-
break;
4068-
}
4066+
opt = { inFor: options.inFor };
4067+
list = [parseVariableDeclaration(opt)];
4068+
4069+
while (match(',')) {
40694070
lex();
4070-
} while (startIndex < length);
4071+
list.push(parseVariableDeclaration(opt));
4072+
}
40714073

40724074
return list;
40734075
}
@@ -4110,15 +4112,12 @@
41104112
}
41114113

41124114
function parseBindingList(kind, options) {
4113-
var list = [];
4115+
var list = [parseLexicalBinding(kind, options)];
41144116

4115-
do {
4116-
list.push(parseLexicalBinding(kind, options));
4117-
if (!match(',')) {
4118-
break;
4119-
}
4117+
while (match(',')) {
41204118
lex();
4121-
} while (startIndex < length);
4119+
list.push(parseLexicalBinding(kind, options));
4120+
}
41224121

41234122
return list;
41244123
}
@@ -4822,7 +4821,7 @@
48224821

48234822
function parseFunctionSourceElements() {
48244823
var statement, body = [], token, directive, firstRestricted,
4825-
oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount,
4824+
oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody,
48264825
node = new Node();
48274826

48284827
expect('{');
@@ -4856,13 +4855,11 @@
48564855
oldInIteration = state.inIteration;
48574856
oldInSwitch = state.inSwitch;
48584857
oldInFunctionBody = state.inFunctionBody;
4859-
oldParenthesisCount = state.parenthesizedCount;
48604858

48614859
state.labelSet = {};
48624860
state.inIteration = false;
48634861
state.inSwitch = false;
48644862
state.inFunctionBody = true;
4865-
state.parenthesizedCount = 0;
48664863

48674864
while (startIndex < length) {
48684865
if (match('}')) {
@@ -4877,7 +4874,6 @@
48774874
state.inIteration = oldInIteration;
48784875
state.inSwitch = oldInSwitch;
48794876
state.inFunctionBody = oldInFunctionBody;
4880-
state.parenthesizedCount = oldParenthesisCount;
48814877

48824878
return node.finishBlockStatement(body);
48834879
}
@@ -5711,7 +5707,7 @@
57115707
}
57125708

57135709
// Sync with *.json manifests.
5714-
exports.version = '2.7.0';
5710+
exports.version = '2.7.2';
57155711

57165712
exports.tokenize = tokenize;
57175713

0 commit comments

Comments
 (0)