-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify
helper-function-name
logic (#16652)
* Simplify `helper-function-name` logic * Simplify renaming logic * Avoid custom wrapper for generators
- Loading branch information
1 parent
ff9d26c
commit 482008c
Showing
6 changed files
with
46 additions
and
110 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
10 changes: 5 additions & 5 deletions
10
D7AE
...plugin-transform-arrow-functions/test/fixtures/arrow-functions/self-referential/output.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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
var fooCalls = []; | ||
var jumpTable = function jumpTable(name, arg) { | ||
if (jumpTable[name]) { | ||
jumpTable[name](arg); | ||
var _jumpTable = function jumpTable(name, arg) { | ||
if (_jumpTable[name]) { | ||
_jumpTable[name](arg); | ||
} | ||
}; | ||
Object.assign(jumpTable, { | ||
Object.assign(_jumpTable, { | ||
foo(arg) { | ||
fooCalls.push(arg); | ||
} | ||
}); | ||
jumpTable('foo', 'bar'); | ||
_jumpTable('foo', 'bar'); | ||
expect(fooCalls[0]).toBe('bar'); |
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
6 changes: 3 additions & 3 deletions
6
...nsform-function-name/test/fixtures/function-name/with-arrow-functions-transform/output.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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
const x = function x() { | ||
return x; | ||
const _x = function x() { | ||
return _x; | ||
}; | ||
const y = function y(x) { | ||
return x(); | ||
}; | ||
const z = { | ||
z: function z() { | ||
return y(x); | ||
return y(_x); | ||
} | ||
}.z; |
22 changes: 5 additions & 17 deletions
22
packages/babel-preset-env/test/fixtures/plugins-integration/issue-15170/output.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
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