mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
emit export declarations for system modules as a part of 'execute' method
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
16
tests/baselines/reference/systemModule14.errors.txt
Normal file
16
tests/baselines/reference/systemModule14.errors.txt
Normal 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}
|
||||
31
tests/baselines/reference/systemModule14.js
Normal file
31
tests/baselines/reference/systemModule14.js
Normal 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);
|
||||
}
|
||||
}
|
||||
});
|
||||
12
tests/cases/compiler/systemModule14.ts
Normal file
12
tests/cases/compiler/systemModule14.ts
Normal 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}
|
||||
Reference in New Issue
Block a user