mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #13871 from Microsoft/master-fix13709
[Fix 13709] - Emit __esmodule
This commit is contained in:
+22
-1
@@ -1,4 +1,4 @@
|
||||
/// <reference path="moduleNameResolver.ts"/>
|
||||
/// <reference path="moduleNameResolver.ts"/>
|
||||
/// <reference path="binder.ts"/>
|
||||
|
||||
/* @internal */
|
||||
@@ -22084,6 +22084,11 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
if (compilerOptions.module !== ModuleKind.ES2015 && compilerOptions.module !== ModuleKind.System && !compilerOptions.noEmit &&
|
||||
!isInAmbientContext(node.parent.parent) && hasModifier(node.parent.parent, ModifierFlags.Export)) {
|
||||
checkESModuleMarker(node.name);
|
||||
}
|
||||
|
||||
const checkLetConstNames = (isLet(node) || isConst(node));
|
||||
|
||||
// 1. LexicalDeclaration : LetOrConst BindingList ;
|
||||
@@ -22096,6 +22101,22 @@ namespace ts {
|
||||
return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name);
|
||||
}
|
||||
|
||||
function checkESModuleMarker(name: Identifier | BindingPattern): boolean {
|
||||
if (name.kind === SyntaxKind.Identifier) {
|
||||
if (unescapeIdentifier(name.text) === "__esModule") {
|
||||
return grammarErrorOnNode(name, Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules);
|
||||
}
|
||||
}
|
||||
else {
|
||||
const elements = (<BindingPattern>name).elements;
|
||||
for (const element of elements) {
|
||||
if (!isOmittedExpression(element)) {
|
||||
return checkESModuleMarker(element.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkGrammarNameInLetOrConstDeclarations(name: Identifier | BindingPattern): boolean {
|
||||
if (name.kind === SyntaxKind.Identifier) {
|
||||
if ((<Identifier>name).originalKeywordKind === SyntaxKind.LetKeyword) {
|
||||
|
||||
@@ -671,6 +671,10 @@
|
||||
"category": "Error",
|
||||
"code": 1215
|
||||
},
|
||||
"Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules.": {
|
||||
"category": "Error",
|
||||
"code": 1216
|
||||
},
|
||||
"Export assignment is not supported when '--module' flag is 'system'.": {
|
||||
"category": "Error",
|
||||
"code": 1218
|
||||
|
||||
@@ -83,6 +83,11 @@ namespace ts {
|
||||
|
||||
const statements: Statement[] = [];
|
||||
const statementOffset = addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor);
|
||||
|
||||
if (!currentModuleInfo.exportEquals) {
|
||||
append(statements, createUnderscoreUnderscoreESModule());
|
||||
}
|
||||
|
||||
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, isStatement, /*optional*/ true));
|
||||
addRange(statements, visitNodes(node.statements, sourceElementVisitor, isStatement, statementOffset));
|
||||
addRange(statements, endLexicalEnvironment());
|
||||
@@ -92,7 +97,6 @@ namespace ts {
|
||||
if (currentModuleInfo.hasExportStarsToExportValues) {
|
||||
addEmitHelper(updated, exportStarHelper);
|
||||
}
|
||||
|
||||
return updated;
|
||||
}
|
||||
|
||||
@@ -371,6 +375,10 @@ namespace ts {
|
||||
const statements: Statement[] = [];
|
||||
const statementOffset = addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor);
|
||||
|
||||
if (!currentModuleInfo.exportEquals) {
|
||||
append(statements, createUnderscoreUnderscoreESModule());
|
||||
}
|
||||
|
||||
// Visit each statement of the module body.
|
||||
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, isStatement, /*optional*/ true));
|
||||
addRange(statements, visitNodes(node.statements, sourceElementVisitor, isStatement, statementOffset));
|
||||
@@ -665,6 +673,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
const generatedName = getGeneratedNameForNode(node);
|
||||
|
||||
if (node.exportClause) {
|
||||
const statements: Statement[] = [];
|
||||
// export { x, y } from "mod";
|
||||
@@ -838,6 +847,7 @@ namespace ts {
|
||||
let statements: Statement[];
|
||||
let variables: VariableDeclaration[];
|
||||
let expressions: Expression[];
|
||||
|
||||
if (hasModifier(node, ModifierFlags.Export)) {
|
||||
let modifiers: NodeArray<Modifier>;
|
||||
|
||||
@@ -1127,43 +1137,39 @@ namespace ts {
|
||||
* @param allowComments Whether to allow comments on the export.
|
||||
*/
|
||||
function appendExportStatement(statements: Statement[] | undefined, exportName: Identifier, expression: Expression, location?: TextRange, allowComments?: boolean): Statement[] | undefined {
|
||||
if (exportName.text === "default") {
|
||||
const sourceFile = getOriginalNode(currentSourceFile, isSourceFile);
|
||||
if (sourceFile && !sourceFile.symbol.exports.get("___esModule")) {
|
||||
if (languageVersion === ScriptTarget.ES3) {
|
||||
statements = append(statements,
|
||||
createStatement(
|
||||
createExportExpression(
|
||||
createIdentifier("__esModule"),
|
||||
createTrue()
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
else {
|
||||
statements = append(statements,
|
||||
createStatement(
|
||||
createCall(
|
||||
createPropertyAccess(createIdentifier("Object"), "defineProperty"),
|
||||
/*typeArguments*/ undefined,
|
||||
[
|
||||
createIdentifier("exports"),
|
||||
createLiteral("__esModule"),
|
||||
createObjectLiteral([
|
||||
createPropertyAssignment("value", createTrue())
|
||||
])
|
||||
]
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
statements = append(statements, createExportStatement(exportName, expression, location, allowComments));
|
||||
return statements;
|
||||
}
|
||||
|
||||
function createUnderscoreUnderscoreESModule() {
|
||||
let statement: Statement;
|
||||
if (languageVersion === ScriptTarget.ES3) {
|
||||
statement = createStatement(
|
||||
createExportExpression(
|
||||
createIdentifier("__esModule"),
|
||||
createLiteral(true)
|
||||
)
|
||||
)
|
||||
}
|
||||
else {
|
||||
statement = createStatement(
|
||||
createCall(
|
||||
createPropertyAccess(createIdentifier("Object"), "defineProperty"),
|
||||
/*typeArguments*/ undefined,
|
||||
[
|
||||
createIdentifier("exports"),
|
||||
createLiteral("__esModule"),
|
||||
createObjectLiteral([
|
||||
createPropertyAssignment("value", createLiteral(true))
|
||||
])
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
setEmitFlags(statement, EmitFlags.CustomPrologue);
|
||||
return statement;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a call to the current file's export function to export a value.
|
||||
*
|
||||
|
||||
@@ -520,7 +520,7 @@ namespace ts.projectSystem {
|
||||
|
||||
const expectedEmittedFileName = "/a/b/f1.js";
|
||||
assert.isTrue(host.fileExists(expectedEmittedFileName));
|
||||
assert.equal(host.readFile(expectedEmittedFileName), `"use strict";\r\nfunction Foo() { return 10; }\r\nexports.Foo = Foo;\r\n`);
|
||||
assert.equal(host.readFile(expectedEmittedFileName), `"use strict";\r\nexports.__esModule = true;\r\nfunction Foo() { return 10; }\r\nexports.Foo = Foo;\r\n`);
|
||||
});
|
||||
|
||||
it("shoud not emit js files in external projects", () => {
|
||||
|
||||
@@ -41,6 +41,7 @@ compile(process.argv.slice(2), {
|
||||
* Please log a "breaking change" issue for any API breaking change affecting this issue
|
||||
*/
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var ts = require("typescript");
|
||||
function compile(fileNames, options) {
|
||||
var program = ts.createProgram(fileNames, options);
|
||||
|
||||
@@ -71,6 +71,7 @@ fileNames.forEach(fileName => {
|
||||
* Please log a "breaking change" issue for any API breaking change affecting this issue
|
||||
*/
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var ts = require("typescript");
|
||||
function delint(sourceFile) {
|
||||
delintNode(sourceFile);
|
||||
|
||||
@@ -43,6 +43,7 @@ export function createProgram(rootFiles: string[], compilerOptionsJson: string):
|
||||
* Please log a "breaking change" issue for any API breaking change affecting this issue
|
||||
*/
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var ts = require("typescript");
|
||||
function printError(error) {
|
||||
if (!error) {
|
||||
|
||||
@@ -23,6 +23,7 @@ console.log(JSON.stringify(result));
|
||||
* Please log a "breaking change" issue for any API breaking change affecting this issue
|
||||
*/
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var ts = require("typescript");
|
||||
var source = "let x: string = 'string'";
|
||||
var result = ts.transpile(source, { module: ts.ModuleKind.CommonJS });
|
||||
|
||||
@@ -116,6 +116,7 @@ watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS });
|
||||
* Please log a "breaking change" issue for any API breaking change affecting this issue
|
||||
*/
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var ts = require("typescript");
|
||||
function watch(rootFileNames, options) {
|
||||
var files = {};
|
||||
|
||||
+2
@@ -31,6 +31,7 @@ export module A {
|
||||
|
||||
//// [part1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var A;
|
||||
(function (A) {
|
||||
var Utils;
|
||||
@@ -44,6 +45,7 @@ var A;
|
||||
})(A = exports.A || (exports.A = {}));
|
||||
//// [part2.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var A;
|
||||
(function (A) {
|
||||
// collision with 'Origin' var in other part of merged module
|
||||
|
||||
@@ -15,6 +15,7 @@ y = moduleA; // should be error
|
||||
|
||||
//// [aliasAssignments_moduleA.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var someClass = (function () {
|
||||
function someClass() {
|
||||
}
|
||||
@@ -23,6 +24,7 @@ var someClass = (function () {
|
||||
exports.someClass = someClass;
|
||||
//// [aliasAssignments_1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var moduleA = require("./aliasAssignments_moduleA");
|
||||
var x = moduleA;
|
||||
x = 1; // Should be error
|
||||
|
||||
@@ -24,6 +24,7 @@ var x: foo.A = foo.bar("hello"); // foo.A should be ok but foo.bar should be err
|
||||
//// [aliasOnMergedModuleInterface_0.js]
|
||||
//// [aliasOnMergedModuleInterface_1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var z;
|
||||
z.bar("hello"); // This should be ok
|
||||
var x = foo.bar("hello"); // foo.A should be ok but foo.bar should be error
|
||||
|
||||
@@ -29,6 +29,7 @@ class C2 {
|
||||
|
||||
//// [aliasUsage1_backbone.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Model = (function () {
|
||||
function Model() {
|
||||
}
|
||||
@@ -47,6 +48,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Backbone = require("./aliasUsage1_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
__extends(VisualizationModel, _super);
|
||||
@@ -58,6 +60,7 @@ var VisualizationModel = (function (_super) {
|
||||
exports.VisualizationModel = VisualizationModel;
|
||||
//// [aliasUsage1_main.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var moduleA = require("./aliasUsage1_moduleA");
|
||||
var C2 = (function () {
|
||||
function C2() {
|
||||
|
||||
@@ -23,6 +23,7 @@ var xs2: typeof moduleA[] = [moduleA];
|
||||
|
||||
//// [aliasUsageInArray_backbone.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var Model = (function () {
|
||||
function Model() {
|
||||
}
|
||||
@@ -41,6 +42,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var Backbone = require("./aliasUsageInArray_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
__extends(VisualizationModel, _super);
|
||||
@@ -52,6 +54,7 @@ var VisualizationModel = (function (_super) {
|
||||
exports.VisualizationModel = VisualizationModel;
|
||||
//// [aliasUsageInArray_main.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var moduleA = require("./aliasUsageInArray_moduleA");
|
||||
var xs = [moduleA];
|
||||
var xs2 = [moduleA];
|
||||
|
||||
@@ -22,6 +22,7 @@ f = (x) => moduleA;
|
||||
|
||||
//// [aliasUsageInFunctionExpression_backbone.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var Model = (function () {
|
||||
function Model() {
|
||||
}
|
||||
@@ -40,6 +41,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var Backbone = require("./aliasUsageInFunctionExpression_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
__extends(VisualizationModel, _super);
|
||||
@@ -51,6 +53,7 @@ var VisualizationModel = (function (_super) {
|
||||
exports.VisualizationModel = VisualizationModel;
|
||||
//// [aliasUsageInFunctionExpression_main.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var moduleA = require("./aliasUsageInFunctionExpression_moduleA");
|
||||
var f = function (x) { return x; };
|
||||
f = function (x) { return moduleA; };
|
||||
|
||||
@@ -26,6 +26,7 @@ var r2 = foo({ a: <IHasVisualizationModel>null });
|
||||
|
||||
//// [aliasUsageInGenericFunction_backbone.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var Model = (function () {
|
||||
function Model() {
|
||||
}
|
||||
@@ -44,6 +45,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var Backbone = require("./aliasUsageInGenericFunction_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
__extends(VisualizationModel, _super);
|
||||
@@ -55,6 +57,7 @@ var VisualizationModel = (function (_super) {
|
||||
exports.VisualizationModel = VisualizationModel;
|
||||
//// [aliasUsageInGenericFunction_main.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var moduleA = require("./aliasUsageInGenericFunction_moduleA");
|
||||
function foo(x) {
|
||||
return x;
|
||||
|
||||
@@ -28,6 +28,7 @@ class N2 {
|
||||
|
||||
//// [aliasUsageInIndexerOfClass_backbone.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var Model = (function () {
|
||||
function Model() {
|
||||
}
|
||||
@@ -46,6 +47,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var Backbone = require("./aliasUsageInIndexerOfClass_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
__extends(VisualizationModel, _super);
|
||||
@@ -57,6 +59,7 @@ var VisualizationModel = (function (_super) {
|
||||
exports.VisualizationModel = VisualizationModel;
|
||||
//// [aliasUsageInIndexerOfClass_main.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var moduleA = require("./aliasUsageInIndexerOfClass_moduleA");
|
||||
var N = (function () {
|
||||
function N() {
|
||||
|
||||
@@ -23,6 +23,7 @@ var c: { y: { z: IHasVisualizationModel } } = { y: { z: moduleA } };
|
||||
|
||||
//// [aliasUsageInObjectLiteral_backbone.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var Model = (function () {
|
||||
function Model() {
|
||||
}
|
||||
@@ -41,6 +42,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var Backbone = require("./aliasUsageInObjectLiteral_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
__extends(VisualizationModel, _super);
|
||||
@@ -52,6 +54,7 @@ var VisualizationModel = (function (_super) {
|
||||
exports.VisualizationModel = VisualizationModel;
|
||||
//// [aliasUsageInObjectLiteral_main.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var moduleA = require("./aliasUsageInObjectLiteral_moduleA");
|
||||
var a = { x: moduleA };
|
||||
var b = { x: moduleA };
|
||||
|
||||
@@ -26,6 +26,7 @@ var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x
|
||||
|
||||
//// [aliasUsageInOrExpression_backbone.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var Model = (function () {
|
||||
function Model() {
|
||||
}
|
||||
@@ -44,6 +45,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var Backbone = require("./aliasUsageInOrExpression_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
__extends(VisualizationModel, _super);
|
||||
@@ -55,6 +57,7 @@ var VisualizationModel = (function (_super) {
|
||||
exports.VisualizationModel = VisualizationModel;
|
||||
//// [aliasUsageInOrExpression_main.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var moduleA = require("./aliasUsageInOrExpression_moduleA");
|
||||
var i;
|
||||
var d1 = i || moduleA;
|
||||
|
||||
@@ -26,6 +26,7 @@ class D extends C<IHasVisualizationModel> {
|
||||
|
||||
//// [aliasUsageInTypeArgumentOfExtendsClause_backbone.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var Model = (function () {
|
||||
function Model() {
|
||||
}
|
||||
@@ -44,6 +45,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var Backbone = require("./aliasUsageInTypeArgumentOfExtendsClause_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
__extends(VisualizationModel, _super);
|
||||
@@ -65,6 +67,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var moduleA = require("./aliasUsageInTypeArgumentOfExtendsClause_moduleA");
|
||||
var C = (function () {
|
||||
function C() {
|
||||
|
||||
@@ -22,6 +22,7 @@ var m: typeof moduleA = i;
|
||||
|
||||
//// [aliasUsageInVarAssignment_backbone.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var Model = (function () {
|
||||
function Model() {
|
||||
}
|
||||
@@ -40,6 +41,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var Backbone = require("./aliasUsageInVarAssignment_backbone");
|
||||
var VisualizationModel = (function (_super) {
|
||||
__extends(VisualizationModel, _super);
|
||||
@@ -51,5 +53,6 @@ var VisualizationModel = (function (_super) {
|
||||
exports.VisualizationModel = VisualizationModel;
|
||||
//// [aliasUsageInVarAssignment_main.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var i;
|
||||
var m = i;
|
||||
|
||||
@@ -20,12 +20,15 @@ export var a = function () {
|
||||
|
||||
//// [aliasUsedAsNameValue_0.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [aliasUsedAsNameValue_1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
function b(a) { return null; }
|
||||
exports.b = b;
|
||||
//// [aliasUsedAsNameValue_2.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
///<reference path='aliasUsedAsNameValue_0.ts' />
|
||||
///<reference path='aliasUsedAsNameValue_1.ts' />
|
||||
var mod = require("./aliasUsedAsNameValue_0");
|
||||
|
||||
@@ -12,6 +12,8 @@ var d = b.q3;
|
||||
|
||||
//// [aliasWithInterfaceExportAssignmentUsedInVarInitializer_0.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [aliasWithInterfaceExportAssignmentUsedInVarInitializer_1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var d = b.q3;
|
||||
|
||||
@@ -12,6 +12,7 @@ export class Foo {
|
||||
|
||||
//// [b.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
}
|
||||
@@ -20,5 +21,6 @@ var Foo = (function () {
|
||||
exports.Foo = Foo;
|
||||
//// [a.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var b_1 = require("./b");
|
||||
exports.x = new b_1["default"].Foo();
|
||||
|
||||
@@ -12,6 +12,7 @@ Foo.default.default.foo();
|
||||
|
||||
//// [a.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var Foo = require("./b");
|
||||
Foo["default"].bar();
|
||||
Foo["default"]["default"].foo();
|
||||
|
||||
@@ -13,5 +13,6 @@ export var x = new Foo();
|
||||
|
||||
//// [a.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var b_1 = require("./b");
|
||||
exports.x = new b_1["default"]();
|
||||
|
||||
@@ -12,6 +12,7 @@ Foo.foo();
|
||||
|
||||
//// [a.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var b_1 = require("./b");
|
||||
b_1["default"].bar();
|
||||
b_1["default"].foo();
|
||||
|
||||
@@ -5,5 +5,6 @@ export const a = 1
|
||||
|
||||
//// [alwaysStrictModule4.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
// Module commonjs
|
||||
exports.a = 1;
|
||||
|
||||
@@ -5,5 +5,6 @@ export const a = 1;
|
||||
|
||||
//// [alwaysStrictModule6.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// Targeting ES5
|
||||
exports.a = 1;
|
||||
|
||||
@@ -28,6 +28,7 @@ var n: number;
|
||||
// Ambient external import declaration referencing ambient external module using top level module name
|
||||
//// [consumer.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
// Ambient external module members are always exported with or without export keyword when module lacks export assignment
|
||||
var imp3 = require("equ2");
|
||||
var n = imp3.x;
|
||||
|
||||
@@ -34,6 +34,7 @@ foo(fileText);
|
||||
|
||||
//// [user.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
///<reference path="declarations.d.ts" />
|
||||
var foobarbaz_1 = require("foobarbaz");
|
||||
foobarbaz_1.foo(foobarbaz_1.baz);
|
||||
|
||||
@@ -4,4 +4,5 @@ export declare module "M" { }
|
||||
//// [ambientExternalModuleInsideNonAmbientExternalModule.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
});
|
||||
|
||||
@@ -19,6 +19,7 @@ declare module "M" {
|
||||
//// [ambientExternalModuleMerging_use.js]
|
||||
define(["require", "exports", "M"], function (require, exports, M) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
// Should be strings
|
||||
var x = M.x;
|
||||
var y = M.y;
|
||||
|
||||
@@ -22,5 +22,6 @@ var c = new A();
|
||||
//// [ambientExternalModuleWithInternalImportDeclaration_1.js]
|
||||
define(["require", "exports", "M"], function (require, exports, A) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var c = new A();
|
||||
});
|
||||
|
||||
@@ -21,5 +21,6 @@ var c = new A();
|
||||
//// [ambientExternalModuleWithoutInternalImportDeclaration_1.js]
|
||||
define(["require", "exports", "M"], function (require, exports, A) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var c = new A();
|
||||
});
|
||||
|
||||
@@ -8,4 +8,5 @@ export declare module M { }
|
||||
//// [ambientInsideNonAmbientExternalModule.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
});
|
||||
|
||||
@@ -6,3 +6,4 @@ export declare namespace Foo {
|
||||
|
||||
//// [ambientNameRestrictions.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
@@ -15,6 +15,7 @@ foo(bar, baz, boom);
|
||||
|
||||
//// [user.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
///<reference path="declarations.d.ts"/>
|
||||
var jquery_1 = require("jquery");
|
||||
var baz = require("fs");
|
||||
|
||||
@@ -14,3 +14,4 @@ import foo from "foo";
|
||||
|
||||
//// [user.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
@@ -16,3 +16,4 @@ import foo, {bar} from "foo";
|
||||
|
||||
//// [user.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
@@ -18,6 +18,7 @@ x($);
|
||||
|
||||
//// [reExportX.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var jquery_1 = require("jquery");
|
||||
exports.x = jquery_1.x;
|
||||
//// [reExportAll.js]
|
||||
@@ -25,9 +26,11 @@ exports.x = jquery_1.x;
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
exports.__esModule = true;
|
||||
__export(require("jquery"));
|
||||
//// [reExportUser.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var reExportX_1 = require("./reExportX");
|
||||
var $ = require("./reExportAll");
|
||||
// '$' is not callable, it is an object.
|
||||
|
||||
@@ -7,5 +7,6 @@ m1.f();
|
||||
//// [amdDependencyComment1.js]
|
||||
///<amd-dependency path='bar'/>
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var m1 = require("m2");
|
||||
m1.f();
|
||||
|
||||
@@ -8,5 +8,6 @@ m1.f();
|
||||
///<amd-dependency path='bar'/>
|
||||
define(["require", "exports", "m2", "bar"], function (require, exports, m1) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
m1.f();
|
||||
});
|
||||
|
||||
@@ -7,5 +7,6 @@ m1.f();
|
||||
//// [amdDependencyCommentName1.js]
|
||||
///<amd-dependency path='bar' name='b'/>
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var m1 = require("m2");
|
||||
m1.f();
|
||||
|
||||
@@ -8,5 +8,6 @@ m1.f();
|
||||
///<amd-dependency path='bar' name='b'/>
|
||||
define(["require", "exports", "bar", "m2"], function (require, exports, b, m1) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
m1.f();
|
||||
});
|
||||
|
||||
@@ -12,5 +12,6 @@ m1.f();
|
||||
///<amd-dependency path='goo' name='c'/>
|
||||
define(["require", "exports", "bar", "goo", "m2", "foo"], function (require, exports, b, c, m1) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
m1.f();
|
||||
});
|
||||
|
||||
@@ -27,6 +27,7 @@ import "unaliasedModule2";
|
||||
///<amd-dependency path='unaliasedModule4'/>
|
||||
define(["require", "exports", "aliasedModule5", "aliasedModule6", "aliasedModule1", "aliasedModule2", "aliasedModule3", "aliasedModule4", "unaliasedModule3", "unaliasedModule4", "unaliasedModule1", "unaliasedModule2"], function (require, exports, n1, n2, r1, aliasedModule2_1, aliasedModule3_1, ns) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
r1;
|
||||
aliasedModule2_1.p1;
|
||||
aliasedModule3_1["default"];
|
||||
|
||||
@@ -15,6 +15,7 @@ if(foo.E1.A === 0){
|
||||
//// [foo_0.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var E1;
|
||||
(function (E1) {
|
||||
E1[E1["A"] = 0] = "A";
|
||||
@@ -25,6 +26,7 @@ define(["require", "exports"], function (require, exports) {
|
||||
//// [foo_1.js]
|
||||
define(["require", "exports", "./foo_0"], function (require, exports, foo) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
if (foo.E1.A === 0) {
|
||||
// Should cause runtime import - interesting optimization possibility, as gets inlined to 0.
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ var e: number = <foo.E1>0;
|
||||
//// [foo_0.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var C1 = (function () {
|
||||
function C1() {
|
||||
this.m1 = 42;
|
||||
@@ -52,6 +53,7 @@ define(["require", "exports"], function (require, exports) {
|
||||
//// [foo_1.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var i;
|
||||
var x = {};
|
||||
var y = false;
|
||||
|
||||
@@ -9,15 +9,15 @@ export default function() {}
|
||||
//// [a.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class default_1 {
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = default_1;
|
||||
});
|
||||
//// [b.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
function default_1() { }
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function default_1() { }
|
||||
exports.default = default_1;
|
||||
});
|
||||
|
||||
@@ -8,12 +8,12 @@ export default function() {}
|
||||
|
||||
//// [a.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class default_1 {
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = default_1;
|
||||
//// [b.js]
|
||||
"use strict";
|
||||
function default_1() { }
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function default_1() { }
|
||||
exports.default = default_1;
|
||||
|
||||
@@ -17,9 +17,9 @@ export default function() {}
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class default_1 {
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = default_1;
|
||||
});
|
||||
//// [b.js]
|
||||
@@ -33,7 +33,7 @@ export default function() {}
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
function default_1() { }
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function default_1() { }
|
||||
exports.default = default_1;
|
||||
});
|
||||
|
||||
@@ -14,10 +14,12 @@ import { foo } from './foo';
|
||||
|
||||
//// [foo.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
function foo() { }
|
||||
exports.foo = foo;
|
||||
//// [bar.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var foo_1 = require("./foo");
|
||||
// These should emit identically
|
||||
foo_1.foo;
|
||||
|
||||
@@ -77,6 +77,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
}
|
||||
};
|
||||
var _this = this;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var missing_1 = require("missing");
|
||||
function f0() {
|
||||
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
|
||||
|
||||
@@ -21,6 +21,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Task = (function (_super) {
|
||||
__extends(Task, _super);
|
||||
function Task() {
|
||||
@@ -66,6 +67,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var task_1 = require("./task");
|
||||
var Test = (function () {
|
||||
function Test() {
|
||||
|
||||
@@ -11,6 +11,7 @@ class Test {
|
||||
|
||||
//// [task.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class Task extends Promise {
|
||||
}
|
||||
exports.Task = Task;
|
||||
@@ -24,6 +25,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class Test {
|
||||
example() {
|
||||
return __awaiter(this, void 0, void 0, function* () { return; });
|
||||
|
||||
@@ -28,9 +28,11 @@ define(["require", "exports"], function (require, exports) {
|
||||
//// [file2.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
});
|
||||
//// [file3.js]
|
||||
define(["require", "exports", "./file2"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var a; // should not work
|
||||
});
|
||||
|
||||
@@ -25,9 +25,11 @@ let a: x.A; // should not work
|
||||
//// [file2.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
});
|
||||
//// [file3.js]
|
||||
define(["require", "exports", "file2"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var a; // should not work
|
||||
});
|
||||
|
||||
@@ -27,9 +27,11 @@ define(["require", "exports"], function (require, exports) {
|
||||
//// [file2.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
});
|
||||
//// [file3.js]
|
||||
define(["require", "exports", "./file2"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var a; // should not work
|
||||
});
|
||||
|
||||
@@ -25,9 +25,11 @@ let a: x.A; // should not work
|
||||
//// [file2.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
});
|
||||
//// [file3.js]
|
||||
define(["require", "exports", "file2"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var a; // should not work
|
||||
});
|
||||
|
||||
@@ -36,11 +36,13 @@ define(["require", "exports"], function (require, exports) {
|
||||
//// [file2.js]
|
||||
define(["require", "exports", "./file1"], function (require, exports, x) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
x.b = 1;
|
||||
});
|
||||
//// [file3.js]
|
||||
define(["require", "exports", "./file1", "./file2"], function (require, exports, x) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var a;
|
||||
var b = x.b;
|
||||
});
|
||||
|
||||
@@ -30,11 +30,13 @@ let b = x.b;
|
||||
//// [file2.js]
|
||||
define(["require", "exports", "file1"], function (require, exports, x) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
x.b = 1;
|
||||
});
|
||||
//// [file3.js]
|
||||
define(["require", "exports", "file1", "file2"], function (require, exports, x) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var a;
|
||||
var b = x.b;
|
||||
});
|
||||
|
||||
@@ -40,11 +40,13 @@ define(["require", "exports"], function (require, exports) {
|
||||
//// [file2.js]
|
||||
define(["require", "exports", "./file1"], function (require, exports, x) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
x.b = 1;
|
||||
});
|
||||
//// [file3.js]
|
||||
define(["require", "exports", "./file1", "./file2"], function (require, exports, x) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var a;
|
||||
var b = x.b;
|
||||
});
|
||||
|
||||
@@ -31,11 +31,13 @@ let b = x.b;
|
||||
//// [file2.js]
|
||||
define(["require", "exports", "file1"], function (require, exports, x) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
x.b = 1;
|
||||
});
|
||||
//// [file3.js]
|
||||
define(["require", "exports", "file1", "file2"], function (require, exports, x) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var a;
|
||||
var b = x.b;
|
||||
});
|
||||
|
||||
@@ -85,10 +85,12 @@ const y = x.id;
|
||||
//// [augmentation.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
});
|
||||
//// [consumer.js]
|
||||
define(["require", "exports", "./augmentation"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var x;
|
||||
var y = x.id;
|
||||
});
|
||||
|
||||
@@ -52,11 +52,13 @@ define(["require", "exports"], function (require, exports) {
|
||||
//// [file2.js]
|
||||
define(["require", "exports", "./file1"], function (require, exports, x) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
x.B.b = 1;
|
||||
});
|
||||
//// [file3.js]
|
||||
define(["require", "exports", "./file1", "./file2"], function (require, exports, x) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var a;
|
||||
var b = a.a;
|
||||
var c = x.B.b;
|
||||
|
||||
@@ -29,10 +29,12 @@ let b = a.a;
|
||||
//// [file2.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
});
|
||||
//// [file3.js]
|
||||
define(["require", "exports", "file2"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var a;
|
||||
var b = a.a;
|
||||
});
|
||||
|
||||
@@ -6,6 +6,7 @@ module c5 { } // should be ok everywhere
|
||||
//// [augmentedTypesExternalModule1.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.a = 1;
|
||||
var c5 = (function () {
|
||||
function c5() {
|
||||
|
||||
@@ -9,4 +9,5 @@ export declare var a: {
|
||||
//// [badExternalModuleReference.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
});
|
||||
|
||||
@@ -21,4 +21,5 @@ import * as http from 'intern/dojo/node!http';
|
||||
/// <reference path="a.d.ts"/>
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
});
|
||||
|
||||
@@ -13,15 +13,18 @@ export let x = 1;
|
||||
//// [app.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.x = 1;
|
||||
});
|
||||
//// [lib1.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.x = 1;
|
||||
});
|
||||
//// [lib2.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.x = 1;
|
||||
});
|
||||
|
||||
@@ -12,5 +12,7 @@ import {x} from "foo";
|
||||
|
||||
//// [app.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [lib.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
@@ -13,5 +13,7 @@ import {x} from "foo";
|
||||
|
||||
//// [lib.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [app.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
@@ -12,5 +12,7 @@ import {x} from "foo";
|
||||
|
||||
//// [app.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [lib.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
@@ -13,5 +13,7 @@ import {x} from "foo";
|
||||
|
||||
//// [lib.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [app.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
@@ -12,5 +12,7 @@ import {x} from "foo";
|
||||
|
||||
//// [app.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [lib.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
@@ -9,5 +9,7 @@ import {x} from "foo";
|
||||
|
||||
//// [app.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [lib.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
@@ -10,5 +10,7 @@ import {x} from "foo";
|
||||
|
||||
//// [lib.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [app.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
@@ -9,5 +9,7 @@ import {x} from "foo";
|
||||
|
||||
//// [app.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [lib.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
@@ -11,5 +11,7 @@ import {x} from "foo";
|
||||
|
||||
//// [lib.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [app.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
@@ -13,6 +13,7 @@ y.m.foo();
|
||||
|
||||
//// [chainedImportAlias_file0.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var m;
|
||||
(function (m) {
|
||||
function foo() { }
|
||||
@@ -20,6 +21,7 @@ var m;
|
||||
})(m = exports.m || (exports.m = {}));
|
||||
//// [chainedImportAlias_file1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var x = require("./chainedImportAlias_file0");
|
||||
var y = x;
|
||||
y.m.foo();
|
||||
|
||||
@@ -35,6 +35,7 @@ export module M1 {
|
||||
|
||||
//// [foo1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var foo2 = require("./foo2");
|
||||
var M1;
|
||||
(function (M1) {
|
||||
@@ -50,6 +51,7 @@ var M1;
|
||||
})(M1 = exports.M1 || (exports.M1 = {}));
|
||||
//// [foo2.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var foo1 = require("./foo1");
|
||||
var M1;
|
||||
(function (M1) {
|
||||
|
||||
@@ -17,6 +17,7 @@ export function foo() {
|
||||
|
||||
//// [app.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
function foo() {
|
||||
return new Object();
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var a_1 = require("./a");
|
||||
exports.b = {
|
||||
f: function () {
|
||||
@@ -61,6 +62,7 @@ var __extends = (this && this.__extends) || (function () {
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var b_1 = require("./b");
|
||||
exports.a = {
|
||||
f: function () {
|
||||
|
||||
@@ -21,6 +21,7 @@ export class Test1 {
|
||||
var field1;
|
||||
//// [classMemberInitializerWithLamdaScoping3_1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var Test1 = (function () {
|
||||
function Test1(field1) {
|
||||
this.field1 = field1;
|
||||
|
||||
@@ -17,8 +17,10 @@ export class Test1 {
|
||||
|
||||
//// [classMemberInitializerWithLamdaScoping3_0.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [classMemberInitializerWithLamdaScoping3_1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var Test1 = (function () {
|
||||
function Test1(field1) {
|
||||
this.field1 = field1;
|
||||
|
||||
@@ -20,6 +20,7 @@ export function foo2() {
|
||||
//// [collisionExportsRequireAndAlias_file1.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
function bar() {
|
||||
}
|
||||
exports.bar = bar;
|
||||
@@ -27,6 +28,7 @@ define(["require", "exports"], function (require, exports) {
|
||||
//// [collisionExportsRequireAndAlias_file3333.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
function bar2() {
|
||||
}
|
||||
exports.bar2 = bar2;
|
||||
@@ -34,6 +36,7 @@ define(["require", "exports"], function (require, exports) {
|
||||
//// [collisionExportsRequireAndAlias_file2.js]
|
||||
define(["require", "exports", "collisionExportsRequireAndAlias_file1", "collisionExportsRequireAndAlias_file3333"], function (require, exports, require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
function foo() {
|
||||
require.bar();
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ module m4 {
|
||||
//// [collisionExportsRequireAndAmbientClass_externalmodule.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var m2;
|
||||
(function (m2) {
|
||||
})(m2 || (m2 = {}));
|
||||
|
||||
@@ -63,6 +63,7 @@ module m4 {
|
||||
//// [collisionExportsRequireAndAmbientEnum_externalmodule.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var m2;
|
||||
(function (m2) {
|
||||
})(m2 || (m2 = {}));
|
||||
|
||||
@@ -16,6 +16,7 @@ module m2 {
|
||||
//// [collisionExportsRequireAndAmbientFunction.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var m2;
|
||||
(function (m2) {
|
||||
var a = 10;
|
||||
|
||||
@@ -97,6 +97,7 @@ module m4 {
|
||||
//// [collisionExportsRequireAndAmbientModule_externalmodule.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
function foo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ module m4 {
|
||||
//// [collisionExportsRequireAndAmbientVar_externalmodule.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var m2;
|
||||
(function (m2) {
|
||||
var a = 10;
|
||||
|
||||
@@ -39,6 +39,7 @@ module m4 {
|
||||
//// [collisionExportsRequireAndClass_externalmodule.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var require = (function () {
|
||||
function require() {
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ module m4 {
|
||||
//// [collisionExportsRequireAndEnum_externalmodule.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var require;
|
||||
(function (require) {
|
||||
require[require["_thisVal1"] = 0] = "_thisVal1";
|
||||
|
||||
@@ -25,6 +25,7 @@ module m2 {
|
||||
//// [collisionExportsRequireAndFunction.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
function exports() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ module m2 {
|
||||
//// [collisionExportsRequireAndInternalModuleAlias.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var m;
|
||||
(function (m) {
|
||||
var c = (function () {
|
||||
|
||||
@@ -94,6 +94,7 @@ module m4 {
|
||||
//// [collisionExportsRequireAndModule_externalmodule.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var require;
|
||||
(function (require) {
|
||||
var C = (function () {
|
||||
|
||||
@@ -17,6 +17,7 @@ export function foo2(): exports.I {
|
||||
//// [collisionExportsRequireAndUninstantiatedModule.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
function foo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ module m4 {
|
||||
//// [collisionExportsRequireAndVar_externalmodule.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
function foo() {
|
||||
}
|
||||
exports.foo = foo;
|
||||
|
||||
@@ -8,6 +8,7 @@ export enum Color {
|
||||
|
||||
//// [commentOnExportEnumDeclaration.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
/**
|
||||
* comment
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user