add new arrows compress option (#2154)

Convert ES5 style anonymous function expressions
to arrow functions if permissible by language semantics.

Note: `arrows` requires that the `ecma` compress option
is set to `6` or greater.

fixes #2150
This commit is contained in:
Alex Lam S.L
2017-06-24 14:45:24 +08:00
committed by GitHub
parent 7b95b63ca1
commit d1f085bce7
7 changed files with 140 additions and 10 deletions

View File

@@ -167,14 +167,14 @@ async_inline: {
async_identifiers: {
input: {
let async = function(x){ console.log("async", x); };
let await = function(x){ console.log("await", x); };
var async = function(x){ console.log("async", x); };
var await = function(x){ console.log("await", x); };
async(1);
await(2);
}
expect: {
let async = function(x){ console.log("async", x); };
let await = function(x){ console.log("await", x); };
var async = function(x){ console.log("async", x); };
var await = function(x){ console.log("await", x); };
async(1);
await(2);
}
@@ -182,7 +182,6 @@ async_identifiers: {
"async 1",
"await 2",
]
node_version: ">=8"
}
async_shorthand_property: {