mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 15:25:54 -06:00
Merge pull request #7251 from Microsoft/exportEquals
emit temp declarations after export equals
This commit is contained in:
commit
647280bc74
@ -7402,8 +7402,8 @@ const _super = (function (geti, seti) {
|
||||
emitExportStarHelper();
|
||||
emitCaptureThisForNodeIfNecessary(node);
|
||||
emitLinesStartingAt(node.statements, startIndex);
|
||||
emitTempDeclarations(/*newLine*/ true);
|
||||
emitExportEquals(/*emitAsReturn*/ true);
|
||||
emitTempDeclarations(/*newLine*/ true);
|
||||
decreaseIndent();
|
||||
writeLine();
|
||||
write("});");
|
||||
@ -7416,8 +7416,8 @@ const _super = (function (geti, seti) {
|
||||
emitExportStarHelper();
|
||||
emitCaptureThisForNodeIfNecessary(node);
|
||||
emitLinesStartingAt(node.statements, startIndex);
|
||||
emitTempDeclarations(/*newLine*/ true);
|
||||
emitExportEquals(/*emitAsReturn*/ false);
|
||||
emitTempDeclarations(/*newLine*/ true);
|
||||
}
|
||||
|
||||
function emitUMDModule(node: SourceFile) {
|
||||
@ -7443,8 +7443,8 @@ const _super = (function (geti, seti) {
|
||||
emitExportStarHelper();
|
||||
emitCaptureThisForNodeIfNecessary(node);
|
||||
emitLinesStartingAt(node.statements, startIndex);
|
||||
emitTempDeclarations(/*newLine*/ true);
|
||||
emitExportEquals(/*emitAsReturn*/ true);
|
||||
emitTempDeclarations(/*newLine*/ true);
|
||||
decreaseIndent();
|
||||
writeLine();
|
||||
write("});");
|
||||
|
||||
9
tests/baselines/reference/exportEqualsAmd.js
Normal file
9
tests/baselines/reference/exportEqualsAmd.js
Normal file
@ -0,0 +1,9 @@
|
||||
//// [exportEqualsAmd.ts]
|
||||
export = { ["hi"]: "there" };
|
||||
|
||||
//// [exportEqualsAmd.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
return (_a = {}, _a["hi"] = "there", _a);
|
||||
var _a;
|
||||
});
|
||||
3
tests/baselines/reference/exportEqualsAmd.symbols
Normal file
3
tests/baselines/reference/exportEqualsAmd.symbols
Normal file
@ -0,0 +1,3 @@
|
||||
=== tests/cases/compiler/exportEqualsAmd.ts ===
|
||||
export = { ["hi"]: "there" };
|
||||
No type information for this code.
|
||||
6
tests/baselines/reference/exportEqualsAmd.types
Normal file
6
tests/baselines/reference/exportEqualsAmd.types
Normal file
@ -0,0 +1,6 @@
|
||||
=== tests/cases/compiler/exportEqualsAmd.ts ===
|
||||
export = { ["hi"]: "there" };
|
||||
>{ ["hi"]: "there" } : { ["hi"]: string; }
|
||||
>"hi" : string
|
||||
>"there" : string
|
||||
|
||||
7
tests/baselines/reference/exportEqualsCommonJs.js
Normal file
7
tests/baselines/reference/exportEqualsCommonJs.js
Normal file
@ -0,0 +1,7 @@
|
||||
//// [exportEqualsCommonJs.ts]
|
||||
export = { ["hi"]: "there" };
|
||||
|
||||
//// [exportEqualsCommonJs.js]
|
||||
"use strict";
|
||||
module.exports = (_a = {}, _a["hi"] = "there", _a);
|
||||
var _a;
|
||||
3
tests/baselines/reference/exportEqualsCommonJs.symbols
Normal file
3
tests/baselines/reference/exportEqualsCommonJs.symbols
Normal file
@ -0,0 +1,3 @@
|
||||
=== tests/cases/compiler/exportEqualsCommonJs.ts ===
|
||||
export = { ["hi"]: "there" };
|
||||
No type information for this code.
|
||||
6
tests/baselines/reference/exportEqualsCommonJs.types
Normal file
6
tests/baselines/reference/exportEqualsCommonJs.types
Normal file
@ -0,0 +1,6 @@
|
||||
=== tests/cases/compiler/exportEqualsCommonJs.ts ===
|
||||
export = { ["hi"]: "there" };
|
||||
>{ ["hi"]: "there" } : { ["hi"]: string; }
|
||||
>"hi" : string
|
||||
>"there" : string
|
||||
|
||||
16
tests/baselines/reference/exportEqualsUmd.js
Normal file
16
tests/baselines/reference/exportEqualsUmd.js
Normal file
@ -0,0 +1,16 @@
|
||||
//// [exportEqualsUmd.ts]
|
||||
export = { ["hi"]: "there" };
|
||||
|
||||
//// [exportEqualsUmd.js]
|
||||
(function (factory) {
|
||||
if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
var v = factory(require, exports); if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === 'function' && define.amd) {
|
||||
define(["require", "exports"], factory);
|
||||
}
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
return (_a = {}, _a["hi"] = "there", _a);
|
||||
var _a;
|
||||
});
|
||||
3
tests/baselines/reference/exportEqualsUmd.symbols
Normal file
3
tests/baselines/reference/exportEqualsUmd.symbols
Normal file
@ -0,0 +1,3 @@
|
||||
=== tests/cases/compiler/exportEqualsUmd.ts ===
|
||||
export = { ["hi"]: "there" };
|
||||
No type information for this code.
|
||||
6
tests/baselines/reference/exportEqualsUmd.types
Normal file
6
tests/baselines/reference/exportEqualsUmd.types
Normal file
@ -0,0 +1,6 @@
|
||||
=== tests/cases/compiler/exportEqualsUmd.ts ===
|
||||
export = { ["hi"]: "there" };
|
||||
>{ ["hi"]: "there" } : { ["hi"]: string; }
|
||||
>"hi" : string
|
||||
>"there" : string
|
||||
|
||||
2
tests/cases/compiler/exportEqualsAmd.ts
Normal file
2
tests/cases/compiler/exportEqualsAmd.ts
Normal file
@ -0,0 +1,2 @@
|
||||
// @module: amd
|
||||
export = { ["hi"]: "there" };
|
||||
2
tests/cases/compiler/exportEqualsCommonJs.ts
Normal file
2
tests/cases/compiler/exportEqualsCommonJs.ts
Normal file
@ -0,0 +1,2 @@
|
||||
// @module: commonjs
|
||||
export = { ["hi"]: "there" };
|
||||
2
tests/cases/compiler/exportEqualsUmd.ts
Normal file
2
tests/cases/compiler/exportEqualsUmd.ts
Normal file
@ -0,0 +1,2 @@
|
||||
// @module: umd
|
||||
export = { ["hi"]: "there" };
|
||||
Loading…
x
Reference in New Issue
Block a user