Age | Commit message (Collapse) | Author |
|
|
|
|
|
fixes #2485
|
|
fixes #2468
|
|
- inline single-use function declarations as expressions when permissible
- depend on `reduce_vars`
- enabled by default
- disable for speed critical code
fixes #2464
|
|
|
|
fixes #2449
|
|
fixes #2450
|
|
fixes #2442
|
|
fixes #2440
|
|
- defer declaration removal in `collapse_vars`
- account for `AST_SymbolFunarg` in deduplication
- private accounting for `collapse_vars`
- avoid issues with identity reference due to deep cloning
fixes #2437
|
|
|
|
fixes #2423
|
|
- only replace same-scope usages
- augment `test/ufuzz.js` to test for `this`
fixes #2420
|
|
- trim array items only if `side_effects`
- extend to non-identifier properties
|
|
|
|
|
|
`{ a: x, b: y }.a` => `[ x, y ][0]`
- `x` cannot be function containing `this`
`[ x, y, z ][1]` => `(x, z, y)`
- only if `z` is side-effect-free
|
|
|
|
|
|
|
|
- constant expression
- single reference
- same scope
- not across loop body
|
|
fixes #2336
|
|
fixes #2198
|
|
fixes #2140
|
|
- empty body
- single `AST_Return`
- single `AST_SimpleStatement`
- avoid `/*#__PURE__*/`
Miscellaneous
- enhance single-use function substitution
fixes #281
|
|
improve function name hack in `run_code()`
|
|
- `reduce_vars`
- `side_effects`
- property access for object
- `AST_SymbolAccessor` as key names
enhance `test/ufuzz.js`
- add object getter & setter
- property assignment to setter
- avoid infinite recursion in setter
- fix & adjust assignment operators
- 50% `=`
- 25% `+=`
- 2.5% each for the rest
- avoid "Invalid array length"
- fix `console.log()`
- bypass getter
- curb recursive reference
- deprecate `-E`, always report runtime errors
|
|
As this is not part of ES5.
|
|
fixes #1922
|
|
|
|
Determine if variables with non-constant values can escape and be modified.
fixes #1865
|
|
Respect "funcs" and "vars" properly.
fixes #1850
|
|
- extract leading value with side-effects out of `var` statement
- reduce scanning of `AST_Definitions` from 3 passes to just once
|
|
`var a=1;a=2;x(a)` => `x(2)`
fix pre-existing issues
- reference counting on assignment
- walking of anonymous functions
- chained assignment
|
|
|
|
Side effects of `&&` and `||` have not mattered until #1814, which takes assignment expressions into account.
|
|
These are surprisingly common, as people reuse the same variable name within loops or switch branches.
|
|
Possible partial execution due to exceptions.
|
|
- allow immediate assignment after declaration of variable
- relax modification rule for immutable value
- fix order of visit for TreeWalker
- remove extraneous code
|
|
- let `collapse_vars` take care of value containing any symbols
- improve overhead accounting
|
|
|
|
Improved catch handling in `figure_out_scope()` means special case treatment of IE8 is no longer valid in `reset_opt_flags()`.
Also fixed recursive assignment in variable definition.
|
|
`AST_Node.optimize()` is context-aware, so don't cache its results to be used elsewhere.
Also fixed a few cases of AST corruption and beef up safety of `pure_getters`.
|
|
- fix side effects in switch condition for singular blocks
- fix `undefined` confusion with local variable
- gate `OPT(AST_Switch)` with `switches`
fixes #1758
fixes #1759
|
|
Process variable definitions with or without assigned values against:
- `arguments`
- named function arguments
- multiple definitions within same scope
Essentially demote variable declarations with no value assignments.
Also fixed invalid use of `AST_VarDef` over `arguments` - should use a member of `AST_SymbolDeclaration` instead.
|
|
|
|
Take conditional nature of switch branches into account.
fixes #1670
|
|
That particular version of Node.js has messed up error messages, so provide a version-specific workaround.
Also fixed an formatting issue which would cause `expect_stdout` to fail if error message contains excerpts of input.
Apply `expect_stdout` to more applicable tests.
|
|
`hoist_vars` converts variable declarations into plain assignments, which then confuses `reduce_vars`
fixes #1606
|