Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export updated assignments when using shorthand update assignment exp…
…ressions in SystemJS (#3242)
- Loading branch information
1 parent
0697166
commit 6dcc4e0
Showing
11 changed files
with
158 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
description: 'Correctly handles assignment operators on exports', | ||
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,20 @@ | ||
define(['exports'], function (exports) { 'use strict'; | ||
|
||
exports.x = 1; | ||
exports.x = 2; | ||
exports.x += 1; | ||
exports.x -= 1; | ||
exports.x *= 2; | ||
exports.x /= 2; | ||
exports.x %= 2; | ||
exports.x **= 2; | ||
exports.x <<= 1; | ||
exports.x >>= 1; | ||
exports.x >>>= 1; | ||
exports.x &= 3; | ||
exports.x ^= 2; | ||
exports.x |= 2; | ||
|
||
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,18 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
exports.x = 1; | ||
exports.x = 2; | ||
exports.x += 1; | ||
exports.x -= 1; | ||
exports.x *= 2; | ||
exports.x /= 2; | ||
exports.x %= 2; | ||
exports.x **= 2; | ||
exports.x <<= 1; | ||
exports.x >>= 1; | ||
exports.x >>>= 1; | ||
exports.x &= 3; | ||
exports.x ^= 2; | ||
exports.x |= 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,16 @@ | ||
let x = 1; | ||
x = 2; | ||
x += 1; | ||
x -= 1; | ||
x *= 2; | ||
x /= 2; | ||
x %= 2; | ||
x **= 2; | ||
x <<= 1; | ||
x >>= 1; | ||
x >>>= 1; | ||
x &= 3; | ||
x ^= 2; | ||
x |= 2; | ||
|
||
export { x }; |
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,21 @@ | ||
var bundle = (function (exports) { | ||
'use strict'; | ||
|
||
exports.x = 1; | ||
exports.x = 2; | ||
exports.x += 1; | ||
exports.x -= 1; | ||
exports.x *= 2; | ||
exports.x /= 2; | ||
exports.x %= 2; | ||
exports.x **= 2; | ||
exports.x <<= 1; | ||
exports.x >>= 1; | ||
exports.x >>>= 1; | ||
exports.x &= 3; | ||
exports.x ^= 2; | ||
exports.x |= 2; | ||
|
||
return exports; | ||
|
||
}({})); |
23 changes: 23 additions & 0 deletions
23
test/form/samples/updating-assignments/_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,23 @@ | ||
System.register('bundle', [], function (exports) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
let x = exports('x', 1); | ||
x = exports('x', 2); | ||
x = exports('x', x + 1); | ||
x = exports('x', x - 1); | ||
x = exports('x', x * 2); | ||
x = exports('x', x / 2); | ||
x = exports('x', x % 2); | ||
x = exports('x', x ** 2); | ||
x = exports('x', x << 1); | ||
x = exports('x', x >> 1); | ||
x = exports('x', x >>> 1); | ||
x = exports('x', x & 3); | ||
x = exports('x', x ^ 2); | ||
x = exports('x', x | 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,24 @@ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(global = global || self, factory(global.bundle = {})); | ||
}(this, (function (exports) { 'use strict'; | ||
|
||
exports.x = 1; | ||
exports.x = 2; | ||
exports.x += 1; | ||
exports.x -= 1; | ||
exports.x *= 2; | ||
exports.x /= 2; | ||
exports.x %= 2; | ||
exports.x **= 2; | ||
exports.x <<= 1; | ||
exports.x >>= 1; | ||
exports.x >>>= 1; | ||
exports.x &= 3; | ||
exports.x ^= 2; | ||
exports.x |= 2; | ||
|
||
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,14 @@ | ||
export let x = 1; | ||
x = 2; | ||
x += 1; | ||
x -= 1; | ||
x *= 2; | ||
x /= 2; | ||
x %= 2; | ||
x **= 2; | ||
x <<= 1; | ||
x >>= 1; | ||
x >>>= 1; | ||
x &= 3; | ||
x ^= 2; | ||
x |= 2; |