process code with implicit return statement (#1522)

Bookmarklet for instance implicitedly assumes a "completion value" without using `return`.
The `expression` option now supports such use cases.
Optimisations on IIFEs also enhanced.

fixes #354
fixes #543
fixes #625
fixes #628
fixes #640
closes #1293
This commit is contained in:
Alex Lam S.L
2017-03-03 18:13:07 +08:00
committed by GitHub
parent 18059cc94f
commit 07accd2fbb
8 changed files with 485 additions and 32 deletions

View File

@@ -640,9 +640,7 @@ call_args: {
expect: {
const a = 1;
console.log(1);
+function(a) {
return 1;
}(1);
+(1, 1);
}
}
@@ -663,9 +661,7 @@ call_args_drop_param: {
expect: {
const a = 1;
console.log(1);
+function() {
return 1;
}(b);
+(b, 1);
}
}