aboutsummaryrefslogtreecommitdiff
path: root/test/compress/arrays.js
AgeCommit message (Expand)Author
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