You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Revert "Revert "Explicitly typed special assignments are context sensitive (microsoft#25619)""
This reverts commit 16676f2.
* Revert "Revert "Explicitly typed prototype assignments are context sensitive (microsoft#25688)""
This reverts commit ff8c30d.
* Initial, wasteful, solution
It burns a check flags. Probably necessary, but perhaps not.
I haven't accepted baselines, but they are a bit questionable. I'm not
sure the synthetic type is right, because I expected to see
{ "exports": typeof import("x") } but instead see { "x": typeof
import("x") }.
* Update some baselines
* module.exports= always uses lhs type
Conflicts between exports property assignments and exports assignments
should get a union type instead of an error.
* Fix lint and accept good user baselines
* Add tests based on user tests.
These currently fail.
* Fix all but 1 of user test bugs found by typing module.exports
Still quite messy and full of notes
* Follow merged symbols+allow any object type
This allows exports like `module.exports = new EE` to have properties
added to them.
Still messy, but I'm going to run user tests and look for regressions.
* Update improved user baselines
* Fix infinite recursion when checking module.exports
* Fix bogus use-before-def error
getExportSymbolOfValueSymbolIfExported should always merge its returned
symbol, whether it's symbol.exportSymbol or just symbol.
* Update user test baselines
* Cleanup
* More small cleanup
* Bind `module` of `module.exports` as a special symbol
Previously it was also special, but created during name resolution in
the checker. It made sense when there was only one special symbol for
all files, but now there is one `module` symbol per file.
Copy file name to clipboardExpand all lines: src/compiler/checker.ts
+45-28
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,6 @@ namespace ts {
76
76
undefinedSymbol.declarations = [];
77
77
const argumentsSymbol = createSymbol(SymbolFlags.Property, "arguments" as __String);
78
78
const requireSymbol = createSymbol(SymbolFlags.Property, "require" as __String);
79
-
const moduleSymbol = createSymbol(SymbolFlags.Property, "module" as __String);
80
79
81
80
/** This will be set during calls to `getResolvedSignature` where services determines an apparent number of arguments greater than what is actually provided. */
82
81
let apparentArgumentCount: number | undefined;
@@ -1422,10 +1421,6 @@ namespace ts {
1422
1421
if (isRequireCall(originalLocation.parent, /*checkArgumentIsStringLiteralLike*/ false)) {
1423
1422
return requireSymbol;
1424
1423
}
1425
-
if (isIdentifier(originalLocation) && isPropertyAccessExpression(originalLocation.parent) &&
0 commit comments