forked from babel/babel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
object rest spread useBuiltIns option (babel#4491)
* feat(transform-object-rest-spread): add polyfill=false option to avoid extends helper * object-rest-spread: add useBuiltIns option * add test for invalid option
- Loading branch information
Showing
7 changed files
with
48 additions
and
1 deletion.
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
1 change: 1 addition & 0 deletions
1
...ransform-object-rest-spread/test/fixtures/useBuiltIns/assignment-invalid-option/actual.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 @@ | ||
z = { x, ...y }; |
4 changes: 4 additions & 0 deletions
4
...sform-object-rest-spread/test/fixtures/useBuiltIns/assignment-invalid-option/options.json
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 @@ | ||
{ | ||
"plugins": [["transform-object-rest-spread", { "useBuiltIns": "invalidOption" }]], | ||
"throws": "transform-object-rest-spread currently only accepts a boolean option for useBuiltIns (defaults to false)" | ||
} |
1 change: 1 addition & 0 deletions
1
...l-plugin-transform-object-rest-spread/test/fixtures/useBuiltIns/assignment-true/actual.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 @@ | ||
z = { x, ...y }; |
1 change: 1 addition & 0 deletions
1
...plugin-transform-object-rest-spread/test/fixtures/useBuiltIns/assignment-true/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 @@ | ||
z = Object.assign({ x }, y); |
3 changes: 3 additions & 0 deletions
3
packages/babel-plugin-transform-object-rest-spread/test/fixtures/useBuiltIns/options.json
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 @@ | ||
{ | ||
"plugins": [["transform-object-rest-spread", { "useBuiltIns": true }]] | ||
} |