-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly export destructured export declarations in SystemJS
- Loading branch information
1 parent
f58d1e6
commit 27be520
Showing
10 changed files
with
128 additions
and
27 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
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
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
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
import { WritableEntity } from '../../Entity'; | ||
import Variable from '../../variables/Variable'; | ||
import { Node } from './Node'; | ||
|
||
export interface PatternNode extends WritableEntity, Node {} | ||
export interface PatternNode extends WritableEntity, Node { | ||
addExportedVariables(variables: Variable[]): void; | ||
} |
8 changes: 8 additions & 0 deletions
8
test/form/samples/system-export-destructuring-assignment/_config.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,8 @@ | ||
module.exports = { | ||
description: 'Supports destructuring declarations and assignments for SystemJS', | ||
options: { | ||
output: { | ||
format: 'system' | ||
} | ||
} | ||
}; |
15 changes: 15 additions & 0 deletions
15
test/form/samples/system-export-destructuring-assignment/_expected.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,15 @@ | ||
System.register([], function (exports, module) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
const {a = 1, ...b} = global1, c = exports('c', global2), {d} = global3; exports({a: a, b: b, d: d}); | ||
const [e, ...f] = global4; exports({e: e, f: f}); | ||
const {g, x: h = 2, y: {z: i}, a: [j ,k,, l]} = global5; exports({g: g, h: h, i: i, j: j, k: k, l: l}); | ||
|
||
var m = exports('m', 1); | ||
var {m} = global6; exports('m', m); | ||
|
||
} | ||
}; | ||
}); |
6 changes: 6 additions & 0 deletions
6
test/form/samples/system-export-destructuring-assignment/main.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,6 @@ | ||
export const {a = 1, ...b} = global1, c = global2, {d} = global3; | ||
export const [e, ...f] = global4; | ||
export const {g, x: h = 2, y: {z: i}, a: [j ,k,, l]} = global5; | ||
|
||
export var m = 1; | ||
var {m} = global6; |