Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect rendering of export declarations in SystemJS (#4202)
- Loading branch information
1 parent
ffd5cad
commit 039420b
Showing
10 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
description: 'handles simplified variable initializers', | ||
options: { output: { name: 'bundle' } } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
define(['exports'], function (exports) { 'use strict'; | ||
|
||
const a = window.config ? 1 : 2; | ||
const b = 1 ; | ||
const c = 2; | ||
|
||
exports.a = a; | ||
exports.b = b; | ||
exports.c = c; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const a = window.config ? 1 : 2; | ||
const b = 1 ; | ||
const c = 2; | ||
|
||
exports.a = a; | ||
exports.b = b; | ||
exports.c = c; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const a = window.config ? 1 : 2; | ||
const b = 1 ; | ||
const c = 2; | ||
|
||
export { a, b, c }; |
16 changes: 16 additions & 0 deletions
16
test/form/samples/simplified-initializer/_expected/iife.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
var bundle = (function (exports) { | ||
'use strict'; | ||
|
||
const a = window.config ? 1 : 2; | ||
const b = 1 ; | ||
const c = 2; | ||
|
||
exports.a = a; | ||
exports.b = b; | ||
exports.c = c; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
return exports; | ||
|
||
}({})); |
12 changes: 12 additions & 0 deletions
12
test/form/samples/simplified-initializer/_expected/system.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
System.register('bundle', [], function (exports) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
const a = exports('a', window.config ? 1 : 2); | ||
const b = exports('b', 1 ); | ||
const c = exports('c', 2); | ||
|
||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {})); | ||
}(this, (function (exports) { 'use strict'; | ||
|
||
const a = window.config ? 1 : 2; | ||
const b = 1 ; | ||
const c = 2; | ||
|
||
exports.a = a; | ||
exports.b = b; | ||
exports.c = c; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const a = window.config ? 1 : 2 | ||
export const b = true ? 1 : 2 | ||
export const c = false ? 1 : 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters