aboutsummaryrefslogtreecommitdiff
path: root/lib/utils.js
AgeCommit message (Collapse)Author
2017-02-21clean up `negate_iife`alexlamsl
- remove extra tree scanning phase for `negate_iife` - `negate_iife` now only deals with the narrowest form, i.e. IIFE sitting directly under `AST_SimpleStatement` - `booleans`, `conditionals` etc. will now take care the rest via more accurate accounting - `a(); void b();` => `a(); b();` fixes #1288 closes #1451
2016-11-29Do not overwrite options.comments + cleanupAnthony Van de Gejuchte
2016-06-30Various LineTerminator changesAnthony Van de Gejuchte
* Escaped newlines should also produce SyntaxError * Fix multiline comment parsing and add tests * Adapt makePredicate to handle \u2028 and \u2029 * Move up nlb check in regex so it's checked before any escape handling * Change error messages to conform ecma standard * Find_eol not recornizing \u2028 and \u2029 as line terminator * Remove \u180e as it is removed in unicode 6.3.0 from the category zs
2016-04-07Simplify member(name, array) implementation.kzc
2016-04-07Avoid using inherited hasOwnPropertyMihai Bazon
Fix #1031
2015-03-14Add property name manglerMihai Bazon
We only touch properties that are present in an object literal, or which are assigned to. Example: x = { foo: 1 }; x.bar = 2; x["baz"] = 3; x[cond ? "qwe" : "asd"] = 4; console.log(x.stuff); The names "foo", "bar", "baz", "qwe" and "asd" will be mangled, and the resulting mangled names will be used for the same properties throughout the code. The "stuff" will not be, since it's just referenced but never assigned to. This *will* break most of the code out there, but could work on carefully written code: do not use eval, do not define methods or properties by walking an array of names, etc. Also, a comprehensive list of exclusions needs to be passed, to avoid mangling properties that are standard in JavaScript, DOM, used in external libraries etc.
2013-12-10semicolonsMihai Bazon
2013-12-10Merge pull request #245 from ForbesLindesay/patch-1Mihai Bazon
Make `DefaultsError` a real `Error` object
2013-11-28Add --noerr to turn off argument name checkingMihai Bazon
for now only used for keys passed to `-c` or `-b`.
2013-07-22Make `DefaultsError` a real `Error` objectForbes Lindesay
2013-05-14Only compress code in `new Function` if all arguments are strings.Mihai Bazon
2012-12-05When hoisting variables, try to merge in assignments that follow.Mihai Bazon
2012-11-06add option to mangle names even if eval/with is in useMihai Bazon
(for more fair comparison to Closure compiler)
2012-11-02use a Dictionary object instead of plain object for hashesMihai Bazon
to mitigate the `__proto__` issue related to #30
2012-10-18more optimizations for some break/continue casesMihai Bazon
2012-10-11stealing more hacks from acorn in the name of speedMihai Bazon
2012-10-11using makeComparator from acorn to generate functions that tests whether aMihai Bazon
string is keyword, reserved etc. speeds up the parser a bit, though not spectacular.. still far from acorn.
2012-10-11cleanupMihai Bazon
- use prototype-less objects where feasible (minor speed improvement) - get rid of HOP
2012-10-02"use strict";Mihai Bazon
2012-10-02a shy attempt to obey `width` in the beautifier; added `bracketize` option ↵Mihai Bazon
to always print brackets around if/do/while/for statements; export more options via the CLI
2012-09-26compressor successfully moved to TreeTransformerMihai Bazon
2012-09-23properly drop mutually-referring declarations that are not otherwiseMihai Bazon
referenced and have no side effects
2012-09-16rewrite handle_if_returnMihai Bazon
optimizations of if/return/continue seem to be even better now
2012-09-12more AST_If optimizationsMihai Bazon
2012-09-11fixed some mess with symbols/scopeMihai Bazon
- all symbols now have a `thedef` property which is a SymbolDef object, instead of the `uniq` that we had before (pointing to the first occurrence of the name as declaration). - for undeclared symbols we still create a SymbolDef object in the toplevel scope but mark it "undeclared" - we can now call figure_out_scope after squeezing, which is useful in order not to mangle names that were dropped by the squeezer
2012-09-10adaptive base54 digits depending on char frequency (WIP)Mihai Bazon
2012-09-10more progress on the compressor (WIP)Mihai Bazon
2012-09-04checkpointMihai Bazon
2012-09-03Reverting "minor perf. improvements"Mihai Bazon
Revert "minor perf. improvements" This reverts commit 24bfd55a22afd791d4a97694641831cfbd27fb14. broke the parser somehow; too early to optimize, let's get the other stuff running.
2012-09-02minor perf. improvementsMihai Bazon
2012-08-27update (c) yearsMihai Bazon
2012-08-22added licenseMihai Bazon
2012-08-20added mangler and other stuffMihai Bazon
2012-08-20doc (WIP)Mihai Bazon
2012-08-19simple visitor API and code to figure out scope and referencesMihai Bazon
2012-06-03WIPMihai Bazon
2012-05-27init repoMihai Bazon