mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-26 00:36:29 -05:00
Add null check when querying for exports from a module
This commit is contained in:
20
tests/cases/compiler/exportDeclarationInInternalModule.ts
Normal file
20
tests/cases/compiler/exportDeclarationInInternalModule.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
// @target: es5
|
||||
// @module: commonjs
|
||||
// @declaration: true
|
||||
|
||||
class Bbb {
|
||||
}
|
||||
|
||||
class Aaa extends Bbb { }
|
||||
|
||||
module Aaa {
|
||||
export class SomeType { }
|
||||
}
|
||||
|
||||
module Bbb {
|
||||
export class SomeType { }
|
||||
|
||||
export * from Aaa; // this line causes the nullref
|
||||
}
|
||||
|
||||
var a: Bbb.SomeType;
|
||||
25
tests/cases/compiler/exportStarFromEmptyModule.ts
Normal file
25
tests/cases/compiler/exportStarFromEmptyModule.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
// @target: es5
|
||||
// @module: commonjs
|
||||
// @declaration: true
|
||||
|
||||
// @filename: exportStarFromEmptyModule_module1.ts
|
||||
export class A {
|
||||
static r;
|
||||
}
|
||||
|
||||
// @filename:exportStarFromEmptyModule_module2.ts
|
||||
// empty
|
||||
|
||||
// @filename: exportStarFromEmptyModule_module3.ts
|
||||
export * from "exportStarFromEmptyModule_module2";
|
||||
export * from "exportStarFromEmptyModule_module1";
|
||||
|
||||
export class A {
|
||||
static q;
|
||||
}
|
||||
|
||||
// @filename: exportStarFromEmptyModule_module4.ts
|
||||
import * as X from "exportStarFromEmptyModule_module3";
|
||||
var s: X.A;
|
||||
X.A.q;
|
||||
X.A.r; // Error
|
||||
Reference in New Issue
Block a user