mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 11:54:44 -06:00
Merge pull request #30719 from andrewbranch/bug/30668
Fix crash when binding deep module.exports assignment
This commit is contained in:
commit
fed46ea3bf
@ -2710,8 +2710,7 @@ namespace ts {
|
||||
}
|
||||
else {
|
||||
const s = forEachIdentifierInEntityName(e.expression, parent, action);
|
||||
if (!s || !s.exports) return Debug.fail();
|
||||
return action(e.name, s.exports.get(e.name.escapedText), s);
|
||||
return action(e.name, s && s.exports && s.exports.get(e.name.escapedText), s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
tests/cases/compiler/a.js(1,9): error TS2339: Property 'a' does not exist on type 'typeof import("tests/cases/compiler/a")'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
exports.a.b.c = 0;
|
||||
~
|
||||
!!! error TS2339: Property 'a' does not exist on type 'typeof import("tests/cases/compiler/a")'.
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/a.js ===
|
||||
exports.a.b.c = 0;
|
||||
>exports : Symbol("tests/cases/compiler/a", Decl(a.js, 0, 0))
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
=== tests/cases/compiler/a.js ===
|
||||
exports.a.b.c = 0;
|
||||
>exports.a.b.c = 0 : 0
|
||||
>exports.a.b.c : any
|
||||
>exports.a.b : any
|
||||
>exports.a : any
|
||||
>exports : typeof import("tests/cases/compiler/a")
|
||||
>a : any
|
||||
>b : any
|
||||
>c : any
|
||||
>0 : 0
|
||||
|
||||
@ -0,0 +1,6 @@
|
||||
// @allowJs: true
|
||||
// @noEmit: true
|
||||
// @checkJs: true
|
||||
// @filename: a.js
|
||||
|
||||
exports.a.b.c = 0;
|
||||
Loading…
x
Reference in New Issue
Block a user