|
1136 | 1136 | }
|
1137 | 1137 |
|
1138 | 1138 | if (quote !== '') {
|
| 1139 | + index = start; |
1139 | 1140 | throwUnexpectedToken();
|
1140 | 1141 | }
|
1141 | 1142 |
|
|
2728 | 2729 |
|
2729 | 2730 | return node.finishProperty(
|
2730 | 2731 | 'init', key, false,
|
2731 |
| - new WrappingNode(keyToken).finishAssignmentPattern(key, init), false, false); |
| 2732 | + new WrappingNode(keyToken).finishAssignmentPattern(key, init), false, true); |
2732 | 2733 | } else if (!match(':')) {
|
2733 | 2734 | params.push(keyToken);
|
2734 | 2735 | return node.finishProperty('init', key, false, key, false, true);
|
|
3263 | 3264 | if (!strict && state.allowYield && matchKeyword('yield')) {
|
3264 | 3265 | return parseNonComputedProperty();
|
3265 | 3266 | }
|
| 3267 | + if (!strict && matchKeyword('let')) { |
| 3268 | + return node.finishIdentifier(lex().value); |
| 3269 | + } |
3266 | 3270 | isAssignmentTarget = isBindingElement = false;
|
3267 | 3271 | if (matchKeyword('function')) {
|
3268 | 3272 | return parseFunctionExpression();
|
|
3274 | 3278 | if (matchKeyword('class')) {
|
3275 | 3279 | return parseClassExpression();
|
3276 | 3280 | }
|
3277 |
| - if (!strict && matchKeyword('let')) { |
3278 |
| - return node.finishIdentifier(lex().value); |
3279 |
| - } |
3280 | 3281 | throwUnexpectedToken(lex());
|
3281 | 3282 | } else if (type === Token.BooleanLiteral) {
|
3282 | 3283 | isAssignmentTarget = isBindingElement = false;
|
|
3854 | 3855 |
|
3855 | 3856 | argument = null;
|
3856 | 3857 | expr = new Node();
|
| 3858 | + delegate = false; |
3857 | 3859 |
|
3858 | 3860 | expectKeyword('yield');
|
3859 | 3861 |
|
|
4059 | 4061 | }
|
4060 | 4062 |
|
4061 | 4063 | function parseVariableDeclarationList(options) {
|
4062 |
| - var list = []; |
| 4064 | + var opt, list; |
4063 | 4065 |
|
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(',')) { |
4069 | 4070 | lex();
|
4070 |
| - } while (startIndex < length); |
| 4071 | + list.push(parseVariableDeclaration(opt)); |
| 4072 | + } |
4071 | 4073 |
|
4072 | 4074 | return list;
|
4073 | 4075 | }
|
|
4110 | 4112 | }
|
4111 | 4113 |
|
4112 | 4114 | function parseBindingList(kind, options) {
|
4113 |
| - var list = []; |
| 4115 | + var list = [parseLexicalBinding(kind, options)]; |
4114 | 4116 |
|
4115 |
| - do { |
4116 |
| - list.push(parseLexicalBinding(kind, options)); |
4117 |
| - if (!match(',')) { |
4118 |
| - break; |
4119 |
| - } |
| 4117 | + while (match(',')) { |
4120 | 4118 | lex();
|
4121 |
| - } while (startIndex < length); |
| 4119 | + list.push(parseLexicalBinding(kind, options)); |
| 4120 | + } |
4122 | 4121 |
|
4123 | 4122 | return list;
|
4124 | 4123 | }
|
|
4822 | 4821 |
|
4823 | 4822 | function parseFunctionSourceElements() {
|
4824 | 4823 | var statement, body = [], token, directive, firstRestricted,
|
4825 |
| - oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount, |
| 4824 | + oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, |
4826 | 4825 | node = new Node();
|
4827 | 4826 |
|
4828 | 4827 | expect('{');
|
|
4856 | 4855 | oldInIteration = state.inIteration;
|
4857 | 4856 | oldInSwitch = state.inSwitch;
|
4858 | 4857 | oldInFunctionBody = state.inFunctionBody;
|
4859 |
| - oldParenthesisCount = state.parenthesizedCount; |
4860 | 4858 |
|
4861 | 4859 | state.labelSet = {};
|
4862 | 4860 | state.inIteration = false;
|
4863 | 4861 | state.inSwitch = false;
|
4864 | 4862 | state.inFunctionBody = true;
|
4865 |
| - state.parenthesizedCount = 0; |
4866 | 4863 |
|
4867 | 4864 | while (startIndex < length) {
|
4868 | 4865 | if (match('}')) {
|
|
4877 | 4874 | state.inIteration = oldInIteration;
|
4878 | 4875 | state.inSwitch = oldInSwitch;
|
4879 | 4876 | state.inFunctionBody = oldInFunctionBody;
|
4880 |
| - state.parenthesizedCount = oldParenthesisCount; |
4881 | 4877 |
|
4882 | 4878 | return node.finishBlockStatement(body);
|
4883 | 4879 | }
|
|
5711 | 5707 | }
|
5712 | 5708 |
|
5713 | 5709 | // Sync with *.json manifests.
|
5714 |
| - exports.version = '2.7.0'; |
| 5710 | + exports.version = '2.7.2'; |
5715 | 5711 |
|
5716 | 5712 | exports.tokenize = tokenize;
|
5717 | 5713 |
|
|
0 commit comments