fix: do not match MySymbol.import("mod")

This commit is contained in:
Joscha Feth
2018-04-12 19:31:07 +10:00
parent edcf087145
commit 4da2e5eda3
5 changed files with 22 additions and 1 deletions

View File

@@ -78,7 +78,7 @@ namespace ts {
*/
function tryConsumeImport(): boolean {
let token = scanner.getToken();
if (token === SyntaxKind.ImportKeyword) {
if (token === SyntaxKind.ImportKeyword && !scanner.hasPrecedingDot()) {
token = nextToken();
if (token === SyntaxKind.OpenParenToken) {
token = nextToken();
@@ -293,6 +293,9 @@ namespace ts {
// export import i = require("mod")
// (for JavaScript files) require("mod")
// Do not look for:
// AnySymbol.import("mod")
while (true) {
if (scanner.getToken() === SyntaxKind.EndOfFileToken) {
break;