aboutsummaryrefslogtreecommitdiff
path: root/test/compress/evaluate.js
AgeCommit message (Expand)Author
2017-12-02more tests for #2535 (#2551)Alex Lam S.L
2017-12-01improve boolean compression (#2548)...fixes #2535Alex Lam S.L
2017-11-11implement compress option `reduce_funcs` (#2466)...- inline single-use function declarations as expressions when permissible - depend on `reduce_vars` - enabled by default - disable for speed critical code fixes #2464Alex Lam S.L
2017-10-29enhance `properties` (#2412)...- trim array items only if `side_effects` - extend to non-identifier propertiesAlex Lam S.L
2017-10-26compress self comparisons (#2398)Alex Lam S.L
2017-10-22safer `properties` transform (#2391)...`{ 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-freeAlex Lam S.L
2017-10-09perform `reduce_vars` on safe literals (#2351)...- constant expression - single reference - same scope - not across loop bodyAlex Lam S.L
2017-07-14fix `unsafe` `evaluate` of `Object` static methods (#2232)...fixes #2231Alex Lam S.L
2017-07-07inlining of static methods & constants (#2211)...- guard by `unsafe` - support `Array`, `Math`, `Number`, `Object` & `String` fixes #2207Alex Lam S.L
2017-07-06inline property access of object literal (#2209)...- only if property value is side-effect-free - guard by `unsafe` fixes #2208Alex Lam S.L
2017-06-06implement function inlining (#2053)...- empty body - single `AST_Return` - single `AST_SimpleStatement` - avoid `/*#__PURE__*/` Miscellaneous - enhance single-use function substitution fixes #281Alex Lam S.L
2017-06-01whitelist `unsafe` `evaluate` candidates (#2039)...- all arguments may accept constant values - return constant value - free of side effects - available & identical across locales and runtime environmentsAlex Lam S.L
2017-06-01enhance `unsafe` `evaluate` (#2037)Alex Lam S.L
2017-05-19introduce `unsafe_regexp` (#1970)...fixes #1964Alex Lam S.L
2017-05-12remove support for `const` (#1910)...As this is not part of ES5.Alex Lam S.L
2017-04-12convert `AST_Seq` from binary tree to array (#1460)...- rename `AST_Seq` to `AST_Sequence` - raise default sequences_limit from 200 to 800Alex Lam S.L
2017-04-09fix LHS cases for NaN & friends (#1804)...`Infinity = beyond` should not become `1/0 = beyond`Alex Lam S.L
2017-04-08fix `delete` corner cases (#1799)...- assignment - boolean - conditional - sequenceAlex Lam S.L
2017-04-07fix corner cases with `delete` (#1796)...`delete Infinity` returns `false` where as `delete (1/0)` returns `true`Alex Lam S.L
2017-04-02avoid confusion of `NaN` & `Infinity` with `catch` symbol of the same name (#......fixes #1760 fixes #1761Alex Lam S.L
2017-04-01improve compression of undefined, NaN & Infinitiy (#1748)...- migrate transformation logic from `OutputStream` to `Compressor` - always turn `undefined` into `void 0` (unless `unsafe`) - always keep `NaN` except when avoiding local variable redefinition - introduce `keep_infinity` to suppress `1/0` transform, except when avoiding local variable redefinition supersedes #1723 fixes #1730Alex Lam S.L
2017-03-29output optimal representations of NaN & Infinity (#1723)...- move these optimisations out from `Compressor` to `OutputStream` - fixes behaviour inconsistency when running uglified code from global or module levels due to redefinitionAlex Lam S.L
2017-03-24fix cascade of `evaluate` optimisation (#1654)...Operator has changed, so break out from rest of the rules. fixes #1649Alex Lam S.L
2017-03-19make `expect_stdout` work on Node.js 0.12 (#1623)...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.Alex Lam S.L
2017-03-19transform String.charAt() to index access (#1620)...Guarded by `unsafe` as `charAt()` can be overridden.Alex Lam S.L
2017-03-03process 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 #1293Alex Lam S.L
2017-03-02trim unused invocation parameters (#1526)Alex Lam S.L
2017-03-01fix `evaluate` on object getter & setter (#1515)Alex Lam S.L
2017-02-28warn & drop `#__PURE__` iff IIFE is dropped (#1511)...- consolidate `side-effects` optimisations - improve string `+` optimisation - enhance literal & `conditionals` optimisationsAlex Lam S.L
2017-02-26consolidate `evaluate` & `reduce_vars` (#1505)...- improve marking efficiency - apply smarter `const` replacement to `var` fixes #1501Alex Lam S.L
2017-02-24enable `collapse_vars` & `reduce_vars` by default...- fix corner cases in `const` optimisation - deprecate `/*@const*/` fixes #1497 closes #1498 alexlamsl
2017-02-21evaluate AST_SymbolRef as parameter...fix invalid boolean conversion now exposed in `make_node_from_constant()` closes #1477 alexlamsl
2017-01-26optimise binary operands with evaluate() (#1427)...- remove call to evaluate() in is_constant() and let nested optimize() does its job instead - reject RegExp in is_constant() and remove special case logic under collapse_vars - operands to conditionals optimisation are now always evaluate()-ed - throw error in constant_value() instead of returning undefined to catch possible bugs, similar to make_node_from_constant() - optimise binary boolean operators under `evaluate` instead of `conditionals`Alex Lam S.L
2017-01-26augment evaluate to extract within objects (#1425)...- gated by `unsafe` - replaces previous optimisation specific to String.length - "123"[0] => 1 - [1, 2, 3][0] => 1 - [1, 2, 3].length => 3 - does not apply to objects with overridden prototype functionsAlex Lam S.L
2016-05-24Completely allow evaluating -0Richard van Velzen
2016-05-17Never produce -0 when evaluating expressions (like -"")...Fix for #1085. The major case was already there, but more expressions can result in -0. Richard van Velzen