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.
Fix: export default arrows with function naming (babel#4524)
- Loading branch information
Showing
13 changed files
with
89 additions
and
7 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...s2015-function-name/test/fixtures/function-name/export-default-arrow-renaming-2/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,3 @@ | ||
export default () => ({ | ||
x: ({x}) => {} | ||
}) |
13 changes: 13 additions & 0 deletions
13
...015-function-name/test/fixtures/function-name/export-default-arrow-renaming-2/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,13 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
exports.default = function () { | ||
return { | ||
x: function x(_ref) { | ||
var _x = _ref.x; | ||
} | ||
}; | ||
}; |
3 changes: 3 additions & 0 deletions
3
...15-function-name/test/fixtures/function-name/export-default-arrow-renaming-2/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 @@ | ||
{ | ||
"presets": ["es2015"] | ||
} |
4 changes: 4 additions & 0 deletions
4
...s2015-function-name/test/fixtures/function-name/export-default-arrow-renaming-3/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,4 @@ | ||
export default ({ onClick }) => ( | ||
<div onClick={() => onClick()} /> | ||
) | ||
|
12 changes: 12 additions & 0 deletions
12
...015-function-name/test/fixtures/function-name/export-default-arrow-renaming-3/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,12 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
exports.default = function (_ref) { | ||
var _onClick = _ref.onClick; | ||
return React.createElement("div", { onClick: function onClick() { | ||
return _onClick(); | ||
} }); | ||
}; |
3 changes: 3 additions & 0 deletions
3
...15-function-name/test/fixtures/function-name/export-default-arrow-renaming-3/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 @@ | ||
{ | ||
"presets": ["es2015", "react"] | ||
} |
3 changes: 3 additions & 0 deletions
3
...015-function-name/test/fixtures/function-name/export-default-arrow-renaming-es3/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,3 @@ | ||
export default (a) => { | ||
return { a() { return a } }; | ||
} |
13 changes: 13 additions & 0 deletions
13
...5-function-name/test/fixtures/function-name/export-default-arrow-renaming-es3/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,13 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
exports["default"] = function (_a) { | ||
return { | ||
a: function a() { | ||
return _a; | ||
} | ||
}; | ||
}; |
7 changes: 7 additions & 0 deletions
7
...-function-name/test/fixtures/function-name/export-default-arrow-renaming-es3/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,7 @@ | ||
{ | ||
"presets": ["es2015"], | ||
"plugins": [ | ||
"transform-es3-member-expression-literals", | ||
"transform-es3-property-literals" | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
...-es2015-function-name/test/fixtures/function-name/export-default-arrow-renaming/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,3 @@ | ||
export default (a) => { | ||
return { a() { return a } }; | ||
} |
13 changes: 13 additions & 0 deletions
13
...s2015-function-name/test/fixtures/function-name/export-default-arrow-renaming/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,13 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
exports.default = function (_a) { | ||
return { | ||
a: function a() { | ||
return _a; | ||
} | ||
}; | ||
}; |
3 changes: 3 additions & 0 deletions
3
...2015-function-name/test/fixtures/function-name/export-default-arrow-renaming/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-es2015-function-name", "transform-es2015-shorthand-properties", "transform-es2015-arrow-functions", "transform-es2015-modules-commonjs"] | ||
} |
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