Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
ignoreFunctionLength
assumption (#12491)
- Loading branch information
1 parent
15baf6c
commit 382107a
Showing
38 changed files
with
118 additions
and
9 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
8 changes: 8 additions & 0 deletions
8
...in-proposal-object-rest-spread/test/fixtures/assumption-ignoreFunctionLength/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,8 @@ | ||
{ | ||
"plugins": [ | ||
"proposal-object-rest-spread" | ||
], | ||
"assumptions": { | ||
"ignoreFunctionLength": true | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
.../fixtures/assumption-ignoreFunctionLength/parameters-object-rest-used-in-default/input.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 @@ | ||
({...R}, a = R) => {} | ||
({...R}, e, c = 2, a = R, f = q) => { let q; } | ||
({...R}, a = f(R)) => {} |
33 changes: 33 additions & 0 deletions
33
...fixtures/assumption-ignoreFunctionLength/parameters-object-rest-used-in-default/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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
|
||
(_ref, a) => { | ||
let R = _extends({}, _ref); | ||
|
||
if (a === void 0) { | ||
a = R; | ||
} | ||
}; | ||
|
||
(_ref2, e, c = 2, a, f) => { | ||
let R = _extends({}, _ref2); | ||
|
||
if (a === void 0) { | ||
a = R; | ||
} | ||
|
||
if (f === void 0) { | ||
f = q; | ||
} | ||
|
||
return function () { | ||
let q; | ||
}(); | ||
}; | ||
|
||
(_ref3, a) => { | ||
let R = _extends({}, _ref3); | ||
|
||
if (a === void 0) { | ||
a = f(R); | ||
} | ||
}; |
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...-spread/test/fixtures/object-spread-loose/parameters-object-rest-used-in-default/input.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 @@ | ||
({...R}, a = R) => {} | ||
({...R}, e, c = 2, a = R, f = q) => { let q; } | ||
({...R}, a = f(R)) => {} |
33 changes: 33 additions & 0 deletions
33
...spread/test/fixtures/object-spread-loose/parameters-object-rest-used-in-default/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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
|
||
(_ref, a) => { | ||
let R = _extends({}, _ref); | ||
|
||
if (a === void 0) { | ||
a = R; | ||
} | ||
}; | ||
|
||
(_ref2, e, c = 2, a, f) => { | ||
let R = _extends({}, _ref2); | ||
|
||
if (a === void 0) { | ||
a = R; | ||
} | ||
|
||
if (f === void 0) { | ||
f = q; | ||
} | ||
|
||
return function () { | ||
let q; | ||
}(); | ||
}; | ||
|
||
(_ref3, a) => { | ||
let R = _extends({}, _ref3); | ||
|
||
if (a === void 0) { | ||
a = f(R); | ||
} | ||
}; |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
packages/babel-plugin-transform-parameters/test/fixtures/loose/ignoreFunctionLength/input.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 @@ | ||
function fn(a, b = c()) { | ||
return b; | ||
} |
7 changes: 7 additions & 0 deletions
7
...ages/babel-plugin-transform-parameters/test/fixtures/loose/ignoreFunctionLength/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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function fn(a, b) { | ||
if (b === void 0) { | ||
b = c(); | ||
} | ||
|
||
return b; | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/babel-plugin-transform-parameters/test/fixtures/loose/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,5 @@ | ||
{ | ||
"plugins": [ | ||
["transform-parameters", { "loose": true }] | ||
] | ||
} |