aboutsummaryrefslogtreecommitdiff
path: root/test/compress/arrays.js
AgeCommit message (Expand)Author
2021-02-22fix corner cases in `reduce_vars` (#4674)Alex Lam S.L
2021-01-24support BigInt literals (#4583)Alex Lam S.L
2020-01-28fix corner case in string concatenations (#3692)...- migrate de-facto compression to `conditionals` & `strings` fixes #3689Alex Lam S.L
2019-03-20enhance `unsafe` for `Array` (#3349)Alex Lam S.L
2018-07-01fix corner case in `unused`alexlamsl
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-27fix `reduce_vars` on `AST_Array.length` (#2404)Alex Lam S.L
2017-10-22fix `unsafe` escape analysis in `reduce_vars` (#2387)Alex Lam S.L
2017-02-21improve string concatenation...shuffle associative operations to minimise parentheses and aid other uglification efforts closes #1454 alexlamsl
2017-02-21fixes & improvements to [].join()...fixes - [a].join() => "" + a - ["a", , "b"].join() => "a,,b" - ["a", null, "b"].join() => "a,,b" - ["a", undefined, "b"].join() => "a,,b" improvements - ["a", "b"].join(null) => "anullb" - ["a", "b"].join(undefined) => "a,b" - [a + "b", c].join("") => a + "b" + c closes #1453 alexlamsl
2017-01-26update test (#1441)...improved reduce_vars & binary operands produce more optimal resultsAlex 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
2013-09-22More attempts to determine when addition is associative...Somebody hit me with bug reports on this. :) Refs #300 Mihai Bazon
2013-09-22Actually let's move away those monsters from the evaluate function...ev() should do a single thing — evaluate constant expressions. if that's not possible, just return the original node. it's not the best place for partial evaluation there, instead doing it in the compress functions. Mihai Bazon
2013-09-22More dirty handling of [ ... ].join() in unsafe mode...Close #300 Mihai Bazon
2013-09-22Evaluate [...].join() if possible: minor bugfix...Follow-up to 78e98d2. Dan Wolff
2013-09-19When `unsafe` is set, evaluate [...].join() if possible...Close #298 Mihai Bazon
2013-07-18Fix output for arrays whose last element is a hole: [1,,]...1529ab96 started to do this (by considering holes to be separate from "undefined") but it still converted [1,,] (length 2, last element hole, trailing comma) to [1,] (length 1, trailing comma) Unfortunately the test suite doesn't really make this clear: the new test here passes with or without this patch because run-tests.js beautifys the expected output (in "make_code"), which does the incorrect transformation! If you make some manual change to arrays.js to make the test fail and see the INPUT and OUTPUT, then you can see that without this fix, [1,,] -> [1,], and with this fix it stays [1,,]. David Glasser
2013-01-17Fix output for arrays containing undefined values....1b6bcca7 was a first attempt at this. That commit made Uglify stop replacing holes with undefined, but instead it started replacing undefined with holes. This is slightly problematic, because there is a difference between a hole and an undefined value. More problematically, it changed [1,undefined] to [1,] which generally doesn't even parse as a hole (just as a trailing comma), so it didn't even preserve the length of the array! Instead, parse holes as their own special AST node which prints invisibly. David Glasser