(
specifier: N.ImportSpecifier,
/* used in TypeScript and Flow parser */
isInTypeOnlyImport: boolean,
bindingType: BindingFlag = BindingFlag.TYPE_LEXICAL,
checkReservedWord: boolean = true,
)
| 3365 | } |
| 3366 | |
| 3367 | checkImportSpecifier( |
| 3368 | specifier: N.ImportSpecifier, |
| 3369 | /* used in TypeScript and Flow parser */ |
| 3370 | isInTypeOnlyImport: boolean, |
| 3371 | bindingType: BindingFlag = BindingFlag.TYPE_LEXICAL, |
| 3372 | checkReservedWord: boolean = true, |
| 3373 | ) { |
| 3374 | const { imported, local } = specifier; |
| 3375 | if (this.isStringModuleExportName(local)) { |
| 3376 | throw this.raise(Errors.ImportBindingIsString, specifier, { |
| 3377 | importName: (imported as N.StringLiteral).value, |
| 3378 | }); |
| 3379 | } |
| 3380 | if (checkReservedWord && local.start === imported.start) { |
| 3381 | this.checkReservedWord(local.name, local.start!, true, true); |
| 3382 | } |
| 3383 | this.checkLVal(local, { type: "ImportSpecifier" }, bindingType); |
| 3384 | } |
| 3385 | |
| 3386 | isStringModuleExportName( |
| 3387 | node: N.Identifier | N.StringLiteral, |
nothing calls this directly
no test coverage detected