Add null check when querying for exports from a module

This commit is contained in:
Mohamed Hegazy
2015-04-06 14:54:22 -07:00
parent c53b0a5016
commit 3ca76ca53b
7 changed files with 241 additions and 1 deletions

View 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;

View 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