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