mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
* add new test case * opt: conditionally apply the flatten transform Only apply the flatten transform when the do expression contains Break/Continue/Return. This enables us to optimize the output since we don't have to memoize intermediate results. * update test outputs * remove unreachable code variable declaration within for in/of can not have initializer. * update test case to cover spread element * add more test cases for early exit scenario * make node 6 happy * revert complex variable declaration removal
11 lines
368 B
JavaScript
11 lines
368 B
JavaScript
function f1(a) {
|
|
(do { if (effects.push(1), a) return 0; (arg) => effects.push(arg) })
|
|
(do { if (effects.push(2), false) return 1; 'arg' });
|
|
}
|
|
|
|
function f2(a) {
|
|
(do { if (effects.push(1), false) return 0; ({ key: (arg) => effects.push(arg) }) })
|
|
[do { if (effects.push(2), a) return 1; 'key' }]
|
|
(...do { if (effects.push(3), false) return [2]; ['arg'] });
|
|
}
|