Skip to content

Commit 03dff41

Browse files
authored
Fix getting completion details for meta properties (#45031)
* Fix getting completion details for meta properties. * Move inside the worker. * Move ImportMeta handling to completions.ts * Fix property type name for new.target. * Use symbols for ImportMeta completions. * Accept baselines. * Revert lib change. * Revert needless parser change. * Missed these reverts. * Remove now unused `isMetaPropertyExpression` * Move up meta property keyword check to be done in `getSymbolAtLocation` and `getTypeOfNode` * Call `checkNewTargetMetaProperty` directly and handle when it's an error type. * Make meta property expression types synthetic. * Make event.target and import.meta properties readonly * Add a test for go to definition (I think?) * Copy built-in types/values test for go to definition. * Add tests for go to definition when not a module. * Fix "go to definition" for new.target
1 parent 318930b commit 03dff41

20 files changed

+235
-8
lines changed

src/compiler/checker.ts

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ namespace ts {
921921
let deferredGlobalAsyncGeneratorType: GenericType;
922922
let deferredGlobalTemplateStringsArrayType: ObjectType;
923923
let deferredGlobalImportMetaType: ObjectType;
924+
let deferredGlobalImportMetaExpressionType: ObjectType;
924925
let deferredGlobalExtractSymbol: Symbol;
925926
let deferredGlobalOmitSymbol: Symbol;
926927
let deferredGlobalBigIntType: ObjectType;
@@ -13324,6 +13325,24 @@ namespace ts {
1332413325
return deferredGlobalImportMetaType || (deferredGlobalImportMetaType = getGlobalType("ImportMeta" as __String, /*arity*/ 0, /*reportErrors*/ true)) || emptyObjectType;
1332513326
}
1332613327

13328+
function getGlobalImportMetaExpressionType() {
13329+
if (!deferredGlobalImportMetaExpressionType) {
13330+
// Create a synthetic type `ImportMetaExpression { meta: MetaProperty }`
13331+
const symbol = createSymbol(SymbolFlags.None, "ImportMetaExpression" as __String);
13332+
const importMetaType = getGlobalImportMetaType();
13333+
13334+
const metaPropertySymbol = createSymbol(SymbolFlags.Property, "meta" as __String, CheckFlags.Readonly);
13335+
metaPropertySymbol.parent = symbol;
13336+
metaPropertySymbol.type = importMetaType;
13337+
13338+
const members = createSymbolTable([metaPropertySymbol]);
13339+
symbol.members = members;
13340+
13341+
deferredGlobalImportMetaExpressionType = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
13342+
}
13343+
return deferredGlobalImportMetaExpressionType;
13344+
}
13345+
1332713346
function getGlobalESSymbolConstructorSymbol(reportErrors: boolean) {
1332813347
return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol" as __String, reportErrors));
1332913348
}
@@ -30465,6 +30484,18 @@ namespace ts {
3046530484
return Debug.assertNever(node.keywordToken);
3046630485
}
3046730486

30487+
function checkMetaPropertyKeyword(node: MetaProperty): Type {
30488+
switch (node.keywordToken) {
30489+
case SyntaxKind.ImportKeyword:
30490+
return getGlobalImportMetaExpressionType();
30491+
case SyntaxKind.NewKeyword:
30492+
const type = checkNewTargetMetaProperty(node);
30493+
return type === errorType ? errorType : createNewTargetExpressionType(type);
30494+
default:
30495+
Debug.assertNever(node.keywordToken);
30496+
}
30497+
}
30498+
3046830499
function checkNewTargetMetaProperty(node: MetaProperty) {
3046930500
const container = getNewTargetContainer(node);
3047030501
if (!container) {
@@ -30487,7 +30518,6 @@ namespace ts {
3048730518
}
3048830519
const file = getSourceFileOfNode(node);
3048930520
Debug.assert(!!(file.flags & NodeFlags.PossiblyContainsImportMeta), "Containing file is missing import meta node flag.");
30490-
Debug.assert(!!file.externalModuleIndicator, "Containing file should be a module.");
3049130521
return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType;
3049230522
}
3049330523

@@ -30849,6 +30879,19 @@ namespace ts {
3084930879
return promiseType;
3085030880
}
3085130881

30882+
function createNewTargetExpressionType(targetType: Type): Type {
30883+
// Create a synthetic type `NewTargetExpression { target: TargetType; }`
30884+
const symbol = createSymbol(SymbolFlags.None, "NewTargetExpression" as __String);
30885+
30886+
const targetPropertySymbol = createSymbol(SymbolFlags.Property, "target" as __String, CheckFlags.Readonly);
30887+
targetPropertySymbol.parent = symbol;
30888+
targetPropertySymbol.type = targetType;
30889+
30890+
const members = createSymbolTable([targetPropertySymbol]);
30891+
symbol.members = members;
30892+
return createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
30893+
}
30894+
3085230895
function getReturnTypeFromBody(func: FunctionLikeDeclaration, checkMode?: CheckMode): Type {
3085330896
if (!func.body) {
3085430897
return errorType;
@@ -39784,6 +39827,16 @@ namespace ts {
3978439827
return propertyDeclaration;
3978539828
}
3978639829
}
39830+
else if (isMetaProperty(parent)) {
39831+
const parentType = getTypeOfNode(parent);
39832+
const propertyDeclaration = getPropertyOfType(parentType, (node as Identifier).escapedText);
39833+
if (propertyDeclaration) {
39834+
return propertyDeclaration;
39835+
}
39836+
if (parent.keywordToken === SyntaxKind.NewKeyword) {
39837+
return checkNewTargetMetaProperty(parent).symbol;
39838+
}
39839+
}
3978739840
}
3978839841

3978939842
switch (node.kind) {
@@ -39858,6 +39911,12 @@ namespace ts {
3985839911
case SyntaxKind.ExportKeyword:
3985939912
return isExportAssignment(node.parent) ? Debug.checkDefined(node.parent.symbol) : undefined;
3986039913

39914+
case SyntaxKind.ImportKeyword:
39915+
case SyntaxKind.NewKeyword:
39916+
return isMetaProperty(node.parent) ? checkMetaPropertyKeyword(node.parent).symbol : undefined;
39917+
case SyntaxKind.MetaProperty:
39918+
return checkExpression(node as Expression).symbol;
39919+
3986139920
default:
3986239921
return undefined;
3986339922
}
@@ -39957,6 +40016,10 @@ namespace ts {
3995740016
}
3995840017
}
3995940018

40019+
if (isMetaProperty(node.parent) && node.parent.keywordToken === node.kind) {
40020+
return checkMetaPropertyKeyword(node.parent);
40021+
}
40022+
3996040023
return errorType;
3996140024
}
3996240025

src/services/completions.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,9 +1355,12 @@ namespace ts.Completions {
13551355
node = (parent as ModuleDeclaration).name;
13561356
break;
13571357
case SyntaxKind.ImportType:
1358-
case SyntaxKind.MetaProperty:
13591358
node = parent;
13601359
break;
1360+
case SyntaxKind.MetaProperty:
1361+
node = parent.getFirstToken(sourceFile)!;
1362+
Debug.assert(node.kind === SyntaxKind.ImportKeyword || node.kind === SyntaxKind.NewKeyword);
1363+
break;
13611364
default:
13621365
// There is nothing that precedes the dot, so this likely just a stray character
13631366
// or leading into a '...' token. Just bail out instead.
@@ -1598,12 +1601,6 @@ namespace ts.Completions {
15981601
}
15991602
}
16001603

1601-
if (isMetaProperty(node) && (node.keywordToken === SyntaxKind.NewKeyword || node.keywordToken === SyntaxKind.ImportKeyword) && contextToken === node.getChildAt(1)) {
1602-
const completion = (node.keywordToken === SyntaxKind.NewKeyword) ? "target" : "meta";
1603-
symbols.push(typeChecker.createSymbol(SymbolFlags.Property, escapeLeadingUnderscores(completion)));
1604-
return;
1605-
}
1606-
16071604
if (!isTypeLocation) {
16081605
let type = typeChecker.getTypeAtLocation(node).getNonOptionalType();
16091606
let insertQuestionDot = false;

tests/baselines/reference/importMeta(module=commonjs,target=es5).symbols

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
88
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
99
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
10+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
1011
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
1112
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
1213

@@ -18,6 +19,7 @@
1819

1920
const size = import.meta.scriptElement.dataset.size || 300;
2021
>size : Symbol(size, Decl(example.ts, 5, 7))
22+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
2123

2224
const image = new Image();
2325
>image : Symbol(image, Decl(example.ts, 7, 7))
@@ -54,6 +56,7 @@
5456
=== tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts ===
5557
export let x = import.meta;
5658
>x : Symbol(x, Decl(moduleLookingFile01.ts, 0, 10))
59+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
5760

5861
export let y = import.metal;
5962
>y : Symbol(y, Decl(moduleLookingFile01.ts, 1, 10))
@@ -64,6 +67,7 @@ export let z = import.import.import.malkovich;
6467
=== tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts ===
6568
let globalA = import.meta;
6669
>globalA : Symbol(globalA, Decl(scriptLookingFile01.ts, 0, 3))
70+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
6771

6872
let globalB = import.metal;
6973
>globalB : Symbol(globalB, Decl(scriptLookingFile01.ts, 1, 3))
@@ -75,8 +79,12 @@ let globalC = import.import.import.malkovich;
7579
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
7680
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
7781
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
82+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
83+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
84+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
7885

7986
import.meta = foo;
87+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
8088
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
8189

8290
// @Filename augmentations.ts
@@ -99,5 +107,6 @@ const { a, b, c } = import.meta.wellKnownProperty;
99107
>b : Symbol(b, Decl(assignmentTargets.ts, 10, 10))
100108
>c : Symbol(c, Decl(assignmentTargets.ts, 10, 13))
101109
>import.meta.wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
110+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
102111
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
103112

tests/baselines/reference/importMeta(module=commonjs,target=esnext).symbols

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
88
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
99
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
10+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
1011
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
1112
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
1213

@@ -18,6 +19,7 @@
1819

1920
const size = import.meta.scriptElement.dataset.size || 300;
2021
>size : Symbol(size, Decl(example.ts, 5, 7))
22+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
2123

2224
const image = new Image();
2325
>image : Symbol(image, Decl(example.ts, 7, 7))
@@ -54,6 +56,7 @@
5456
=== tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts ===
5557
export let x = import.meta;
5658
>x : Symbol(x, Decl(moduleLookingFile01.ts, 0, 10))
59+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
5760

5861
export let y = import.metal;
5962
>y : Symbol(y, Decl(moduleLookingFile01.ts, 1, 10))
@@ -64,6 +67,7 @@ export let z = import.import.import.malkovich;
6467
=== tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts ===
6568
let globalA = import.meta;
6669
>globalA : Symbol(globalA, Decl(scriptLookingFile01.ts, 0, 3))
70+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
6771

6872
let globalB = import.metal;
6973
>globalB : Symbol(globalB, Decl(scriptLookingFile01.ts, 1, 3))
@@ -75,8 +79,12 @@ let globalC = import.import.import.malkovich;
7579
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
7680
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
7781
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
82+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
83+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
84+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
7885

7986
import.meta = foo;
87+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
8088
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
8189

8290
// @Filename augmentations.ts
@@ -99,5 +107,6 @@ const { a, b, c } = import.meta.wellKnownProperty;
99107
>b : Symbol(b, Decl(assignmentTargets.ts, 10, 10))
100108
>c : Symbol(c, Decl(assignmentTargets.ts, 10, 13))
101109
>import.meta.wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
110+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
102111
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
103112

tests/baselines/reference/importMeta(module=es2020,target=es5).symbols

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
88
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
99
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
10+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
1011
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
1112
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
1213

@@ -18,6 +19,7 @@
1819

1920
const size = import.meta.scriptElement.dataset.size || 300;
2021
>size : Symbol(size, Decl(example.ts, 5, 7))
22+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
2123

2224
const image = new Image();
2325
>image : Symbol(image, Decl(example.ts, 7, 7))
@@ -54,6 +56,7 @@
5456
=== tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts ===
5557
export let x = import.meta;
5658
>x : Symbol(x, Decl(moduleLookingFile01.ts, 0, 10))
59+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
5760

5861
export let y = import.metal;
5962
>y : Symbol(y, Decl(moduleLookingFile01.ts, 1, 10))
@@ -64,6 +67,7 @@ export let z = import.import.import.malkovich;
6467
=== tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts ===
6568
let globalA = import.meta;
6669
>globalA : Symbol(globalA, Decl(scriptLookingFile01.ts, 0, 3))
70+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
6771

6872
let globalB = import.metal;
6973
>globalB : Symbol(globalB, Decl(scriptLookingFile01.ts, 1, 3))
@@ -75,8 +79,12 @@ let globalC = import.import.import.malkovich;
7579
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
7680
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
7781
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
82+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
83+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
84+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
7885

7986
import.meta = foo;
87+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
8088
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
8189

8290
// @Filename augmentations.ts
@@ -99,5 +107,6 @@ const { a, b, c } = import.meta.wellKnownProperty;
99107
>b : Symbol(b, Decl(assignmentTargets.ts, 10, 10))
100108
>c : Symbol(c, Decl(assignmentTargets.ts, 10, 13))
101109
>import.meta.wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
110+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
102111
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
103112

tests/baselines/reference/importMeta(module=es2020,target=esnext).symbols

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
88
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
99
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
10+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
1011
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
1112
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
1213

@@ -18,6 +19,7 @@
1819

1920
const size = import.meta.scriptElement.dataset.size || 300;
2021
>size : Symbol(size, Decl(example.ts, 5, 7))
22+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
2123

2224
const image = new Image();
2325
>image : Symbol(image, Decl(example.ts, 7, 7))
@@ -54,6 +56,7 @@
5456
=== tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts ===
5557
export let x = import.meta;
5658
>x : Symbol(x, Decl(moduleLookingFile01.ts, 0, 10))
59+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
5760

5861
export let y = import.metal;
5962
>y : Symbol(y, Decl(moduleLookingFile01.ts, 1, 10))
@@ -64,6 +67,7 @@ export let z = import.import.import.malkovich;
6467
=== tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts ===
6568
let globalA = import.meta;
6669
>globalA : Symbol(globalA, Decl(scriptLookingFile01.ts, 0, 3))
70+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
6771

6872
let globalB = import.metal;
6973
>globalB : Symbol(globalB, Decl(scriptLookingFile01.ts, 1, 3))
@@ -75,8 +79,12 @@ let globalC = import.import.import.malkovich;
7579
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
7680
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
7781
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
82+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
83+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
84+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
7885

7986
import.meta = foo;
87+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
8088
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
8189

8290
// @Filename augmentations.ts
@@ -99,5 +107,6 @@ const { a, b, c } = import.meta.wellKnownProperty;
99107
>b : Symbol(b, Decl(assignmentTargets.ts, 10, 10))
100108
>c : Symbol(c, Decl(assignmentTargets.ts, 10, 13))
101109
>import.meta.wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
110+
>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
102111
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
103112

0 commit comments

Comments
 (0)