diff --git a/lib/tsc.js b/lib/tsc.js index 2d7ba1407d4..a2ce0c5d0ca 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -15554,7 +15554,7 @@ var ts; } function parseLeftHandSideExpressionOrHigher() { var expression; - if (token() === 91) { + if (token() === 91 && lookAhead(nextTokenIsOpenParenOrLessThan)) { sourceFile.flags |= 524288; expression = parseTokenNode(); } @@ -18760,7 +18760,20 @@ var ts; ts.forEachChild(node, bind, bindEach); } function bindChildrenWorker(node) { - ts.forEach(node.jsDoc, bind); + if (node.jsDoc) { + if (ts.isInJavaScriptFile(node)) { + for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) { + var j = _a[_i]; + bind(j); + } + } + else { + for (var _b = 0, _c = node.jsDoc; _b < _c.length; _b++) { + var j = _c[_b]; + setParentPointers(node, j); + } + } + } if (checkUnreachable(node)) { bindEachChild(node); return; @@ -19805,7 +19818,8 @@ var ts; } node.parent = parent; var saveInStrictMode = inStrictMode; - bindJSDocTypedefTagIfAny(node); + if (ts.isInJavaScriptFile(node)) + bindJSDocTypedefTagIfAny(node); bindWorker(node); if (node.kind > 142) { var saveParent = parent; @@ -19865,7 +19879,7 @@ var ts; function bindWorker(node) { switch (node.kind) { case 71: - if (ts.isInJavaScriptFile(node) && node.isInJSDocNamespace) { + if (node.isInJSDocNamespace) { var parentNode = node.parent; while (parentNode && parentNode.kind !== 291) { parentNode = parentNode.parent; @@ -19925,10 +19939,7 @@ var ts; case 158: return checkTypePredicate(node); case 145: - if (node.parent.kind !== 290 || ts.isInJavaScriptFile(node)) { - return declareSymbolAndAddToSymbolTable(node, 262144, 530920); - } - return; + return declareSymbolAndAddToSymbolTable(node, 262144, 530920); case 146: return bindParameter(node); case 226: @@ -19999,10 +20010,7 @@ var ts; case 232: return bindEnumDeclaration(node); case 233: - if (node.parent.kind !== 291 || ts.isInJavaScriptFile(node)) { - return bindModuleDeclaration(node); - } - return undefined; + return bindModuleDeclaration(node); case 254: return bindJsxAttributes(node); case 253: @@ -20029,13 +20037,6 @@ var ts; } case 234: return updateStrictModeStatementList(node.statements); - default: - if (ts.isInJavaScriptFile(node)) - return bindJSDocWorker(node); - } - } - function bindJSDocWorker(node) { - switch (node.kind) { case 276: return bindPropertyWorker(node); case 292: @@ -21021,6 +21022,10 @@ var ts; } } ts.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions; + function setParentPointers(parent, child) { + child.parent = parent; + ts.forEachChild(child, function (childsChild) { return setParentPointers(child, childsChild); }); + } })(ts || (ts = {})); var ts; (function (ts) { @@ -22632,8 +22637,9 @@ var ts; error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); return undefined; } - if (meaning & 2 || - ((meaning & 32 || meaning & 384) && (meaning & 107455) === 107455)) { + if (errorLocation && + (meaning & 2 || + ((meaning & 32 || meaning & 384) && (meaning & 107455) === 107455))) { var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result); if (exportOrLocalSymbol.flags & 2 || exportOrLocalSymbol.flags & 32 || exportOrLocalSymbol.flags & 384) { checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); @@ -55596,6 +55602,9 @@ var ts; if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { oldProgram.structureIsReused = 1; } + if ((oldSourceFile.flags & 524288) !== (newSourceFile.flags & 524288)) { + oldProgram.structureIsReused = 1; + } if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) { oldProgram.structureIsReused = 1; } diff --git a/lib/tsserver.js b/lib/tsserver.js index dd82c1b4fee..4d5b7fbb7f5 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -17391,7 +17391,7 @@ var ts; } function parseLeftHandSideExpressionOrHigher() { var expression; - if (token() === 91) { + if (token() === 91 && lookAhead(nextTokenIsOpenParenOrLessThan)) { sourceFile.flags |= 524288; expression = parseTokenNode(); } @@ -20662,7 +20662,20 @@ var ts; ts.forEachChild(node, bind, bindEach); } function bindChildrenWorker(node) { - ts.forEach(node.jsDoc, bind); + if (node.jsDoc) { + if (ts.isInJavaScriptFile(node)) { + for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) { + var j = _a[_i]; + bind(j); + } + } + else { + for (var _b = 0, _c = node.jsDoc; _b < _c.length; _b++) { + var j = _c[_b]; + setParentPointers(node, j); + } + } + } if (checkUnreachable(node)) { bindEachChild(node); return; @@ -21712,7 +21725,8 @@ var ts; } node.parent = parent; var saveInStrictMode = inStrictMode; - bindJSDocTypedefTagIfAny(node); + if (ts.isInJavaScriptFile(node)) + bindJSDocTypedefTagIfAny(node); bindWorker(node); if (node.kind > 142) { var saveParent = parent; @@ -21772,7 +21786,7 @@ var ts; function bindWorker(node) { switch (node.kind) { case 71: - if (ts.isInJavaScriptFile(node) && node.isInJSDocNamespace) { + if (node.isInJSDocNamespace) { var parentNode = node.parent; while (parentNode && parentNode.kind !== 291) { parentNode = parentNode.parent; @@ -21832,10 +21846,7 @@ var ts; case 158: return checkTypePredicate(node); case 145: - if (node.parent.kind !== 290 || ts.isInJavaScriptFile(node)) { - return declareSymbolAndAddToSymbolTable(node, 262144, 530920); - } - return; + return declareSymbolAndAddToSymbolTable(node, 262144, 530920); case 146: return bindParameter(node); case 226: @@ -21906,10 +21917,7 @@ var ts; case 232: return bindEnumDeclaration(node); case 233: - if (node.parent.kind !== 291 || ts.isInJavaScriptFile(node)) { - return bindModuleDeclaration(node); - } - return undefined; + return bindModuleDeclaration(node); case 254: return bindJsxAttributes(node); case 253: @@ -21936,13 +21944,6 @@ var ts; } case 234: return updateStrictModeStatementList(node.statements); - default: - if (ts.isInJavaScriptFile(node)) - return bindJSDocWorker(node); - } - } - function bindJSDocWorker(node) { - switch (node.kind) { case 276: return bindPropertyWorker(node); case 292: @@ -22928,6 +22929,10 @@ var ts; } } ts.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions; + function setParentPointers(parent, child) { + child.parent = parent; + ts.forEachChild(child, function (childsChild) { return setParentPointers(child, childsChild); }); + } })(ts || (ts = {})); var ts; (function (ts) { @@ -23826,8 +23831,9 @@ var ts; error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); return undefined; } - if (meaning & 2 || - ((meaning & 32 || meaning & 384) && (meaning & 107455) === 107455)) { + if (errorLocation && + (meaning & 2 || + ((meaning & 32 || meaning & 384) && (meaning & 107455) === 107455))) { var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result); if (exportOrLocalSymbol.flags & 2 || exportOrLocalSymbol.flags & 32 || exportOrLocalSymbol.flags & 384) { checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); @@ -57028,6 +57034,9 @@ var ts; if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { oldProgram.structureIsReused = 1; } + if ((oldSourceFile.flags & 524288) !== (newSourceFile.flags & 524288)) { + oldProgram.structureIsReused = 1; + } if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) { oldProgram.structureIsReused = 1; } diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 12658b28268..17a5f7886be 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -18788,7 +18788,7 @@ var ts; } function parseLeftHandSideExpressionOrHigher() { var expression; - if (token() === 91) { + if (token() === 91 && lookAhead(nextTokenIsOpenParenOrLessThan)) { sourceFile.flags |= 524288; expression = parseTokenNode(); } @@ -22059,7 +22059,20 @@ var ts; ts.forEachChild(node, bind, bindEach); } function bindChildrenWorker(node) { - ts.forEach(node.jsDoc, bind); + if (node.jsDoc) { + if (ts.isInJavaScriptFile(node)) { + for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) { + var j = _a[_i]; + bind(j); + } + } + else { + for (var _b = 0, _c = node.jsDoc; _b < _c.length; _b++) { + var j = _c[_b]; + setParentPointers(node, j); + } + } + } if (checkUnreachable(node)) { bindEachChild(node); return; @@ -23109,7 +23122,8 @@ var ts; } node.parent = parent; var saveInStrictMode = inStrictMode; - bindJSDocTypedefTagIfAny(node); + if (ts.isInJavaScriptFile(node)) + bindJSDocTypedefTagIfAny(node); bindWorker(node); if (node.kind > 142) { var saveParent = parent; @@ -23169,7 +23183,7 @@ var ts; function bindWorker(node) { switch (node.kind) { case 71: - if (ts.isInJavaScriptFile(node) && node.isInJSDocNamespace) { + if (node.isInJSDocNamespace) { var parentNode = node.parent; while (parentNode && parentNode.kind !== 291) { parentNode = parentNode.parent; @@ -23229,10 +23243,7 @@ var ts; case 158: return checkTypePredicate(node); case 145: - if (node.parent.kind !== 290 || ts.isInJavaScriptFile(node)) { - return declareSymbolAndAddToSymbolTable(node, 262144, 530920); - } - return; + return declareSymbolAndAddToSymbolTable(node, 262144, 530920); case 146: return bindParameter(node); case 226: @@ -23303,10 +23314,7 @@ var ts; case 232: return bindEnumDeclaration(node); case 233: - if (node.parent.kind !== 291 || ts.isInJavaScriptFile(node)) { - return bindModuleDeclaration(node); - } - return undefined; + return bindModuleDeclaration(node); case 254: return bindJsxAttributes(node); case 253: @@ -23333,13 +23341,6 @@ var ts; } case 234: return updateStrictModeStatementList(node.statements); - default: - if (ts.isInJavaScriptFile(node)) - return bindJSDocWorker(node); - } - } - function bindJSDocWorker(node) { - switch (node.kind) { case 276: return bindPropertyWorker(node); case 292: @@ -24325,6 +24326,10 @@ var ts; } } ts.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions; + function setParentPointers(parent, child) { + child.parent = parent; + ts.forEachChild(child, function (childsChild) { return setParentPointers(child, childsChild); }); + } })(ts || (ts = {})); var ts; (function (ts) { @@ -25223,8 +25228,9 @@ var ts; error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); return undefined; } - if (meaning & 2 || - ((meaning & 32 || meaning & 384) && (meaning & 107455) === 107455)) { + if (errorLocation && + (meaning & 2 || + ((meaning & 32 || meaning & 384) && (meaning & 107455) === 107455))) { var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result); if (exportOrLocalSymbol.flags & 2 || exportOrLocalSymbol.flags & 32 || exportOrLocalSymbol.flags & 384) { checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); @@ -58425,6 +58431,9 @@ var ts; if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { oldProgram.structureIsReused = 1; } + if ((oldSourceFile.flags & 524288) !== (newSourceFile.flags & 524288)) { + oldProgram.structureIsReused = 1; + } if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) { oldProgram.structureIsReused = 1; } diff --git a/lib/typescript.js b/lib/typescript.js index b7487aeaa44..0f2444e0aad 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -19198,7 +19198,7 @@ var ts; // 3)we have a MemberExpression which either completes the LeftHandSideExpression, // or starts the beginning of the first four CallExpression productions. var expression; - if (token() === 91 /* ImportKeyword */) { + if (token() === 91 /* ImportKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { // We don't want to eagerly consume all import keyword as import call expression so we look a head to find "(" // For example: // var foo3 = require("subfolder @@ -23094,7 +23094,20 @@ var ts; // Binding of JsDocComment should be done before the current block scope container changes. // because the scope of JsDocComment should not be affected by whether the current node is a // container or not. - ts.forEach(node.jsDoc, bind); + if (node.jsDoc) { + if (ts.isInJavaScriptFile(node)) { + for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) { + var j = _a[_i]; + bind(j); + } + } + else { + for (var _b = 0, _c = node.jsDoc; _b < _c.length; _b++) { + var j = _c[_b]; + setParentPointers(node, j); + } + } + } if (checkUnreachable(node)) { bindEachChild(node); return; @@ -24280,7 +24293,8 @@ var ts; // Here the current node is "foo", which is a container, but the scope of "MyType" should // not be inside "foo". Therefore we always bind @typedef before bind the parent node, // and skip binding this tag later when binding all the other jsdoc tags. - bindJSDocTypedefTagIfAny(node); + if (ts.isInJavaScriptFile(node)) + bindJSDocTypedefTagIfAny(node); // First we bind declaration nodes to a symbol if possible. We'll both create a symbol // and then potentially add the symbol to an appropriate symbol table. Possible // destination symbol tables are: @@ -24362,7 +24376,7 @@ var ts; // for typedef type names with namespaces, bind the new jsdoc type symbol here // because it requires all containing namespaces to be in effect, namely the // current "blockScopeContainer" needs to be set to its immediate namespace parent. - if (ts.isInJavaScriptFile(node) && node.isInJSDocNamespace) { + if (node.isInJSDocNamespace) { var parentNode = node.parent; while (parentNode && parentNode.kind !== 291 /* JSDocTypedefTag */) { parentNode = parentNode.parent; @@ -24424,10 +24438,7 @@ var ts; case 158 /* TypePredicate */: return checkTypePredicate(node); case 145 /* TypeParameter */: - if (node.parent.kind !== 290 /* JSDocTemplateTag */ || ts.isInJavaScriptFile(node)) { - return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); - } - return; + return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); case 146 /* Parameter */: return bindParameter(node); case 226 /* VariableDeclaration */: @@ -24504,10 +24515,7 @@ var ts; case 232 /* EnumDeclaration */: return bindEnumDeclaration(node); case 233 /* ModuleDeclaration */: - if (node.parent.kind !== 291 /* JSDocTypedefTag */ || ts.isInJavaScriptFile(node)) { - return bindModuleDeclaration(node); - } - return undefined; + return bindModuleDeclaration(node); // Jsx-attributes case 254 /* JsxAttributes */: return bindJsxAttributes(node); @@ -24537,13 +24545,6 @@ var ts; // falls through case 234 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - default: - if (ts.isInJavaScriptFile(node)) - return bindJSDocWorker(node); - } - } - function bindJSDocWorker(node) { - switch (node.kind) { case 276 /* JSDocRecordMember */: return bindPropertyWorker(node); case 292 /* JSDocPropertyTag */: @@ -25739,6 +25740,14 @@ var ts; } } ts.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions; + /** + * "Binds" JSDoc nodes in TypeScript code. + * Since we will never create symbols for JSDoc, we just set parent pointers instead. + */ + function setParentPointers(parent, child) { + child.parent = parent; + ts.forEachChild(child, function (childsChild) { return setParentPointers(child, childsChild); }); + } })(ts || (ts = {})); /// /// @@ -27723,7 +27732,7 @@ var ts; error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); return undefined; } - // Only check for block-scoped variable if we are looking for the + // Only check for block-scoped variable if we have an error location and are looking for the // name with variable meaning // For example, // declare module foo { @@ -27734,8 +27743,9 @@ var ts; // block-scoped variable and namespace module. However, only when we // try to resolve name in /*1*/ which is used in variable position, // we want to check for block-scoped - if (meaning & 2 /* BlockScopedVariable */ || - ((meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 107455 /* Value */) === 107455 /* Value */)) { + if (errorLocation && + (meaning & 2 /* BlockScopedVariable */ || + ((meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 107455 /* Value */) === 107455 /* Value */))) { var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result); if (exportOrLocalSymbol.flags & 2 /* BlockScopedVariable */ || exportOrLocalSymbol.flags & 32 /* Class */ || exportOrLocalSymbol.flags & 384 /* Enum */) { checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); @@ -69580,6 +69590,10 @@ var ts; // moduleAugmentations has changed oldProgram.structureIsReused = 1 /* SafeModules */; } + if ((oldSourceFile.flags & 524288 /* PossiblyContainsDynamicImport */) !== (newSourceFile.flags & 524288 /* PossiblyContainsDynamicImport */)) { + // dynamicImport has changed + oldProgram.structureIsReused = 1 /* SafeModules */; + } if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) { // 'types' references has changed oldProgram.structureIsReused = 1 /* SafeModules */; diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index b7487aeaa44..0f2444e0aad 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -19198,7 +19198,7 @@ var ts; // 3)we have a MemberExpression which either completes the LeftHandSideExpression, // or starts the beginning of the first four CallExpression productions. var expression; - if (token() === 91 /* ImportKeyword */) { + if (token() === 91 /* ImportKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { // We don't want to eagerly consume all import keyword as import call expression so we look a head to find "(" // For example: // var foo3 = require("subfolder @@ -23094,7 +23094,20 @@ var ts; // Binding of JsDocComment should be done before the current block scope container changes. // because the scope of JsDocComment should not be affected by whether the current node is a // container or not. - ts.forEach(node.jsDoc, bind); + if (node.jsDoc) { + if (ts.isInJavaScriptFile(node)) { + for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) { + var j = _a[_i]; + bind(j); + } + } + else { + for (var _b = 0, _c = node.jsDoc; _b < _c.length; _b++) { + var j = _c[_b]; + setParentPointers(node, j); + } + } + } if (checkUnreachable(node)) { bindEachChild(node); return; @@ -24280,7 +24293,8 @@ var ts; // Here the current node is "foo", which is a container, but the scope of "MyType" should // not be inside "foo". Therefore we always bind @typedef before bind the parent node, // and skip binding this tag later when binding all the other jsdoc tags. - bindJSDocTypedefTagIfAny(node); + if (ts.isInJavaScriptFile(node)) + bindJSDocTypedefTagIfAny(node); // First we bind declaration nodes to a symbol if possible. We'll both create a symbol // and then potentially add the symbol to an appropriate symbol table. Possible // destination symbol tables are: @@ -24362,7 +24376,7 @@ var ts; // for typedef type names with namespaces, bind the new jsdoc type symbol here // because it requires all containing namespaces to be in effect, namely the // current "blockScopeContainer" needs to be set to its immediate namespace parent. - if (ts.isInJavaScriptFile(node) && node.isInJSDocNamespace) { + if (node.isInJSDocNamespace) { var parentNode = node.parent; while (parentNode && parentNode.kind !== 291 /* JSDocTypedefTag */) { parentNode = parentNode.parent; @@ -24424,10 +24438,7 @@ var ts; case 158 /* TypePredicate */: return checkTypePredicate(node); case 145 /* TypeParameter */: - if (node.parent.kind !== 290 /* JSDocTemplateTag */ || ts.isInJavaScriptFile(node)) { - return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); - } - return; + return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); case 146 /* Parameter */: return bindParameter(node); case 226 /* VariableDeclaration */: @@ -24504,10 +24515,7 @@ var ts; case 232 /* EnumDeclaration */: return bindEnumDeclaration(node); case 233 /* ModuleDeclaration */: - if (node.parent.kind !== 291 /* JSDocTypedefTag */ || ts.isInJavaScriptFile(node)) { - return bindModuleDeclaration(node); - } - return undefined; + return bindModuleDeclaration(node); // Jsx-attributes case 254 /* JsxAttributes */: return bindJsxAttributes(node); @@ -24537,13 +24545,6 @@ var ts; // falls through case 234 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - default: - if (ts.isInJavaScriptFile(node)) - return bindJSDocWorker(node); - } - } - function bindJSDocWorker(node) { - switch (node.kind) { case 276 /* JSDocRecordMember */: return bindPropertyWorker(node); case 292 /* JSDocPropertyTag */: @@ -25739,6 +25740,14 @@ var ts; } } ts.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions; + /** + * "Binds" JSDoc nodes in TypeScript code. + * Since we will never create symbols for JSDoc, we just set parent pointers instead. + */ + function setParentPointers(parent, child) { + child.parent = parent; + ts.forEachChild(child, function (childsChild) { return setParentPointers(child, childsChild); }); + } })(ts || (ts = {})); /// /// @@ -27723,7 +27732,7 @@ var ts; error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); return undefined; } - // Only check for block-scoped variable if we are looking for the + // Only check for block-scoped variable if we have an error location and are looking for the // name with variable meaning // For example, // declare module foo { @@ -27734,8 +27743,9 @@ var ts; // block-scoped variable and namespace module. However, only when we // try to resolve name in /*1*/ which is used in variable position, // we want to check for block-scoped - if (meaning & 2 /* BlockScopedVariable */ || - ((meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 107455 /* Value */) === 107455 /* Value */)) { + if (errorLocation && + (meaning & 2 /* BlockScopedVariable */ || + ((meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 107455 /* Value */) === 107455 /* Value */))) { var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result); if (exportOrLocalSymbol.flags & 2 /* BlockScopedVariable */ || exportOrLocalSymbol.flags & 32 /* Class */ || exportOrLocalSymbol.flags & 384 /* Enum */) { checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); @@ -69580,6 +69590,10 @@ var ts; // moduleAugmentations has changed oldProgram.structureIsReused = 1 /* SafeModules */; } + if ((oldSourceFile.flags & 524288 /* PossiblyContainsDynamicImport */) !== (newSourceFile.flags & 524288 /* PossiblyContainsDynamicImport */)) { + // dynamicImport has changed + oldProgram.structureIsReused = 1 /* SafeModules */; + } if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) { // 'types' references has changed oldProgram.structureIsReused = 1 /* SafeModules */;