implement function inlining (#2053)

- empty body
- single `AST_Return`
- single `AST_SimpleStatement`
- avoid `/*#__PURE__*/`

Miscellaneous
- enhance single-use function substitution

fixes #281
This commit is contained in:
Alex Lam S.L
2017-06-06 05:49:53 +08:00
committed by GitHub
parent 27c5284d3d
commit 3493a182b2
11 changed files with 528 additions and 29 deletions

View File

@@ -644,6 +644,7 @@ unsafe_prototype_function: {
call_args: {
options = {
evaluate: true,
inline: true,
reduce_vars: true,
toplevel: true,
}
@@ -665,6 +666,7 @@ call_args: {
call_args_drop_param: {
options = {
evaluate: true,
inline: true,
keep_fargs: false,
reduce_vars: true,
toplevel: true,