emit export declarations for system modules as a part of 'execute' method

This commit is contained in:
Vladimir Matveev
2015-08-05 21:45:04 -07:00
parent 2b8ef5e6fd
commit eab6911bce
6 changed files with 124 additions and 83 deletions

View File

@@ -16,17 +16,17 @@ System.register(['file1', 'file2'], function(exports_1) {
setters:[
function (_file1_1) {
file1_1 = _file1_1;
exports_1("n", file1_1["default"]);
exports_1("n1", file1_1["default"]);
exports_1("x", file1_1.x);
exports_1("y", file1_1.x);
},
function (_n2) {
n2 = _n2;
exports_1("n2", n2);
exports_1("n3", n2);
}],
execute: function() {
exports_1("x", file1_1.x);
exports_1("y", file1_1.x);
exports_1("n", file1_1["default"]);
exports_1("n1", file1_1["default"]);
exports_1("n2", n2);
exports_1("n3", n2);
}
}
});

View File

@@ -16,17 +16,17 @@ System.register(['file1', 'file2'], function(exports_1) {
setters:[
function (_file1_1) {
file1_1 = _file1_1;
exports_1("n", file1_1.default);
exports_1("n1", file1_1.default);
exports_1("x", file1_1.x);
exports_1("y", file1_1.x);
},
function (_n2) {
n2 = _n2;
exports_1("n2", n2);
exports_1("n3", n2);
}],
execute: function() {
exports_1("x", file1_1.x);
exports_1("y", file1_1.x);
exports_1("n", file1_1.default);
exports_1("n1", file1_1.default);
exports_1("n2", n2);
exports_1("n3", n2);
}
}
});

View File

@@ -0,0 +1,16 @@
tests/cases/compiler/systemModule14.ts(6,17): error TS2307: Cannot find module 'foo'.
==== tests/cases/compiler/systemModule14.ts (1 errors) ====
function foo() {
return a;
}
import {a} from "foo";
~~~~~
!!! error TS2307: Cannot find module 'foo'.
export {foo}
var x = 1;
export {foo as b}

View File

@@ -0,0 +1,31 @@
//// [systemModule14.ts]
function foo() {
return a;
}
import {a} from "foo";
export {foo}
var x = 1;
export {foo as b}
//// [systemModule14.js]
System.register(["foo"], function(exports_1) {
var foo_1;
var x;
function foo() {
return foo_1.a;
}
return {
setters:[
function (_foo_1) {
foo_1 = _foo_1;
}],
execute: function() {
exports_1("foo", foo);
x = 1;
exports_1("b", foo);
}
}
});

View File

@@ -0,0 +1,12 @@
// @module: system
// @isolatedModules: true
function foo() {
return a;
}
import {a} from "foo";
export {foo}
var x = 1;
export {foo as b}