()
| 3360 | |
| 3361 | // import {<foo as bar>} ...; |
| 3362 | parseImportSpecifier(): Node.ImportSpecifier { |
| 3363 | const node = this.createNode(); |
| 3364 | |
| 3365 | let imported: Node.Identifier; |
| 3366 | let local: Node.Identifier; |
| 3367 | if (this.lookahead.type === Token.Identifier) { |
| 3368 | imported = this.parseVariableIdentifier(); |
| 3369 | local = imported; |
| 3370 | if (this.matchContextualKeyword('as')) { |
| 3371 | this.nextToken(); |
| 3372 | local = this.parseVariableIdentifier(); |
| 3373 | } |
| 3374 | } else { |
| 3375 | imported = this.parseIdentifierName(); |
| 3376 | local = imported; |
| 3377 | if (this.matchContextualKeyword('as')) { |
| 3378 | this.nextToken(); |
| 3379 | local = this.parseVariableIdentifier(); |
| 3380 | } else { |
| 3381 | this.throwUnexpectedToken(this.nextToken()); |
| 3382 | } |
| 3383 | } |
| 3384 | |
| 3385 | return this.finalize(node, new Node.ImportSpecifier(local, imported)); |
| 3386 | } |
| 3387 | |
| 3388 | // {foo, bar as bas} |
| 3389 | parseNamedImports(): Node.ImportSpecifier[] { |
no test coverage detected