enhance arrows (#4403)

This commit is contained in:
Alex Lam S.L
2020-12-18 06:55:20 +00:00
committed by GitHub
parent d2c50ace99
commit 9c0718b162
2 changed files with 32 additions and 14 deletions

View File

@@ -320,6 +320,8 @@ inline_this: {
trim_body: {
options = {
arrows: true,
if_return: true,
side_effects: true,
}
input: {
var f = a => {
@@ -337,6 +339,25 @@ trim_body: {
node_version: ">=4"
}
collapse_value: {
options = {
arrows: true,
collapse_vars: true,
keep_fargs: "strict",
unused: true,
}
input: {
var a = 42;
console.log((b => Math.floor(b))(a));
}
expect: {
var a = 42;
console.log((() => Math.floor(a))());
}
expect_stdout: "42"
node_version: ">=4"
}
reduce_iife_1: {
options = {
evaluate: true,