* Implement new logic for wrapping binary op in arrowFunctionExpression. * Add new test cases. * Reuse new helper function in order to fix #917. * Add new test case. * Extend heuristic to dive deeper into mixed types. * Add new test. * Enhance logic to cover more cases. * Add new test cases. * Disable Flow as it gets BindExpression as an unexpected token. * Simplify getCombinedDeepest function. * Add missing case. * Extract all conditions in switch cases to one top level condition. * Refactor implementation to make it cleaner and also handle ExpressionStatement. * Update related test cases. * Add new test case. * Make condition less expensive. * Clean up unecessary conditions, simplify condition involving startsWithOpenCurlyBrace. * Update and add new test cases for better coverage. * Remove unecessary condition, refactor canBeFirstInStatement to drop some useless parens. * Update test cases accordingly 🚀.
27 lines
555 B
JavaScript
27 lines
555 B
JavaScript
(a => {}).length
|
|
typeof (() => {});
|
|
export default (() => {})();
|
|
(() => {})()``;
|
|
(() => {})``;
|
|
new (() => {});
|
|
if ((() => {}) ? 1 : 0) {}
|
|
let f = () => ({}())
|
|
let a = () => ({} instanceof a);
|
|
a = () => ({} && a);
|
|
a = () => ({}() && a);
|
|
a = () => ({} && a && b);
|
|
a = () => ({} + a);
|
|
a = () => ({}()() && a);
|
|
a = () => ({}.b && a);
|
|
a = () => ({}[b] && a);
|
|
a = () => ({}`` && a);
|
|
a = () => ({} = 0);
|
|
a = () => ({}, a);
|
|
a => a instanceof {};
|
|
a => ({}().b && 0)
|
|
a => ({}::b()``[''].c++ && 0 ? 0 : 0)
|
|
a => ({}().c = 0)
|
|
x => ({}()())
|
|
x => ({}()``)
|
|
x => ({}().b)
|