(kind)
| 7073 | } |
| 7074 | |
| 7075 | function parseVariableDeclaration(kind) { |
| 7076 | var id, |
| 7077 | marker = markerCreate(), |
| 7078 | init = null, |
| 7079 | typeAnnotationMarker = markerCreate(); |
| 7080 | if (match('{')) { |
| 7081 | id = parseObjectInitialiser(); |
| 7082 | reinterpretAsAssignmentBindingPattern(id); |
| 7083 | if (match(':')) { |
| 7084 | id.typeAnnotation = parseTypeAnnotation(); |
| 7085 | markerApply(typeAnnotationMarker, id); |
| 7086 | } |
| 7087 | } else if (match('[')) { |
| 7088 | id = parseArrayInitialiser(); |
| 7089 | reinterpretAsAssignmentBindingPattern(id); |
| 7090 | if (match(':')) { |
| 7091 | id.typeAnnotation = parseTypeAnnotation(); |
| 7092 | markerApply(typeAnnotationMarker, id); |
| 7093 | } |
| 7094 | } else { |
| 7095 | /* istanbul ignore next */ |
| 7096 | id = state.allowKeyword ? parseNonComputedProperty() : parseTypeAnnotatableIdentifier(); |
| 7097 | // 12.2.1 |
| 7098 | if (strict && isRestrictedWord(id.name)) { |
| 7099 | throwErrorTolerant({}, Messages.StrictVarName); |
| 7100 | } |
| 7101 | } |
| 7102 | |
| 7103 | if (kind === 'const') { |
| 7104 | if (!match('=')) { |
| 7105 | throwError({}, Messages.NoUninitializedConst); |
| 7106 | } |
| 7107 | expect('='); |
| 7108 | init = parseAssignmentExpression(); |
| 7109 | } else if (match('=')) { |
| 7110 | lex(); |
| 7111 | init = parseAssignmentExpression(); |
| 7112 | } |
| 7113 | |
| 7114 | return markerApply(marker, delegate.createVariableDeclarator(id, init)); |
| 7115 | } |
| 7116 | |
| 7117 | function parseVariableDeclarationList(kind) { |
| 7118 | var list = []; |
no test coverage detected