Fábio Santos
a3f094013d
Don't mangle exported symbols
2016-03-22 11:44:21 +02:00
Fábio Santos
59c66fc2e1
Implement the export statement
2016-03-22 11:43:58 +02:00
Fábio Santos
7b3e4d4fb2
Mangling externally imported names by using aliasing
2016-03-22 11:43:58 +02:00
Fábio Santos
07fde71cac
importing names in the modules, not just default imports
2016-03-22 11:43:58 +02:00
Fábio Santos
b8adc79433
Importing names from places
2016-03-22 11:43:58 +02:00
Fábio Santos
5f511fe34f
Starting out the import statement
2016-03-22 11:43:58 +02:00
Fábio Santos
6a95d60abd
Move the idea of a symbol having a default value up the class chain.
2016-03-22 11:43:57 +02:00
Fábio Santos
600ff2f6be
Destructuring parameters with defaults. function x({ foo, bar } = {}) { }
2016-03-22 11:43:57 +02:00
Fábio Santos
166f1138bc
Non-destructuring default parameters
2016-03-22 11:43:36 +02:00
Fábio Santos
e6b005fd37
Move the idea of a symbol having a default value up the class chain.
2016-03-22 11:42:34 +02:00
Fábio Santos
752a7affc8
Destructuring parameters with defaults. function x({ foo, bar } = {}) { }
2016-03-22 11:42:34 +02:00
Fábio Santos
5b4490d82e
Non-destructuring default parameters
2016-03-22 11:42:34 +02:00
Fábio Santos
7527699589
Implement new.target
2016-03-22 11:42:34 +02:00
Fábio Santos
7a2394f417
Separate class expressions from class declarations and their symbols like defuns
2016-03-22 11:42:05 +02:00
Fábio Santos
46158d5114
Make AST_Class inherit AST_Scope instead of AST_Object
...
This is one of those days I'd love to use multiple inheritance.
An AST_Class has lots of common with AST_Object, but unfortunately
`instanceof AST_Scope` is used very, very much, and a class has its name
inside its own special pocket scope. This compels me to make AST_Class
inherit Scope instead.
It looks like, although there is much in common with AST_Object,
`instanceof AST_Object` seldom are made, perhaps because it is less
often necessary to traverse an object than a scope.
2016-03-22 11:42:05 +02:00
Fábio Santos
7ea3ab6b58
static properties
2016-03-22 11:41:01 +02:00
Fábio Santos
a9a38ade1d
Starting ES6 classes
2016-03-22 11:41:01 +02:00
Fábio Santos
24b8e1203e
Create a new symbol for methods' names
2016-03-22 11:41:01 +02:00
Fábio Santos
8c05450ce0
start concise methods
2016-03-22 11:41:01 +02:00
Fábio Santos
bfeb1afad0
computed properties
2016-03-22 11:41:01 +02:00
Fábio Santos
4ec5d8f644
parse, output the let statement
2016-03-22 11:41:00 +02:00
Fábio Santos
2a24fa8d2b
prefixed template strings, like "String.rawfoo\nbar".
2016-03-22 11:41:00 +02:00
Fábio Santos
e0b78bfa5f
Parse and output ES6 template strings. Yikes!
2016-03-22 11:41:00 +02:00
Fábio Santos
048eac6b29
Tolerate expansions in vardefs, too!
2016-03-22 11:41:00 +02:00
Fábio Santos
3b189f86ff
Parse and compress destructuring VarDefs
2016-03-22 11:40:44 +02:00
Fábio Santos
5efbe1604e
A little refactoring. Add a new function to get all symbols in a destructuring.
2016-03-22 11:40:44 +02:00
Fábio Santos
0a4270b358
Super!
2016-03-22 11:40:26 +02:00
Fábio Santos
7f825c8244
expand parameters
...
Conflicts:
test/compress/harmony.js
2016-03-22 11:40:26 +02:00
Fábio Santos
df95318e8b
=> with destructuring arguments. Requires a lot of parser changes
2016-03-22 11:40:26 +02:00
Fábio Santos
aa127457d5
Adding arrow functions
2016-03-22 11:40:26 +02:00
Fábio Santos
e4b87bface
for...of
2016-03-22 11:39:49 +02:00
Fábio Santos
6645da0ea2
remove trace statement
2016-03-22 11:39:49 +02:00
Fábio Santos
aaa8f25bf0
Starting destructuring.
2016-03-22 11:39:49 +02:00
Mihai Bazon
08623aa6a7
Fix output for "use asm" code from SpiderMonkey AST
...
(will only work properly if the SM tree contains "raw" properties for
Literal number nodes)
2015-11-12 12:18:25 +02:00
Mihai Bazon
7691bebea5
Rework has_directive
...
It's now available during tree walking, i.e. walker.has_directive("use
asm"), rather than as part of the scope. It's thus no longer necessary
to call `figure_out_scope` before codegen. Added special bits in the
code generator to overcome the fact that it doesn't inherit from
TreeWalker.
Fix #861
2015-11-11 22:15:25 +02:00
kzc
4d2f7d83af
Fix handling of "use asm" when no command line flags are passed to uglifyjs. SCOPE_IS_NEEDED is unconditionally true now. Refactored floating point literal parsing to be more in keeping with the AST class design.
2015-10-07 13:10:53 -04:00
Mihai Bazon
99233c44cc
No longer use vm to load code.
...
Improves performance 2x on node > 0.10.
Ref #636
2015-09-24 17:58:51 +03:00
Mihai Bazon
33528002b4
Fix wrap_commonjs to include code first
...
(code could have directives, i.e. "use strict")
2015-09-24 17:58:51 +03:00
Mihai Bazon
fbbaa42ee5
Add option to preserve/enforce string quote style
...
`-q 0` (default) use single or double quotes such as to minimize the number of
bytes (prefers double quotes when both will do); this is the previous
behavior.
`-q 1` -- always use single quotes
`-q 2` -- always use double quotes
`-q 3` or just `-q` -- always use the original quotes.
Related codegen option: `quote_style`.
Close #495
Close #460
Some `yargs` guru please tell me why `uglifyjs --help` doesn't display the
help string for `-q` / `--quotes`, and why it doesn't output the expected
argument types anymore, like good old `optimist` did.
2015-01-27 22:26:27 +02:00
Ingvar Stepanyan
ae5366a31d
Track ending lines/columns; fix end locations in Mozilla AST.
2015-01-06 11:32:41 +01:00
Mihai Bazon
6b23cbc852
AST_Do nodes: walk body before condition
2015-01-06 12:29:07 +02:00
Arnavion
e2e09d5754
Allow colons in the pairs passed to AST_Toplevel.wrap_enclose
2014-03-22 18:02:21 -07:00
Mihai Bazon
8f35a363d9
AST_Catch shouldn't really inherit from AST_Scope. Fix #363
...
I hereby acknowledge that figure_out_scope has become a mess.
2013-12-05 13:30:29 +02:00
Mihai Bazon
d2190c2bf3
Properly scope catch identifier when --screw-ie8
...
Fix #344
2013-11-28 16:43:30 +02:00
Mihai Bazon
c5ed2292bf
Fix parsing setters/getters (allow keywords for name).
...
The "key" property was always "set" or "get", which didn't make much sense.
Now it'll be the actual name of the setter/getter (AST_Node), and the
AST_Accessor object itself, which represents the function, won't store any
name.
Close #319
2013-10-30 11:50:22 +02:00
Mihai Bazon
cb9d16fbe4
minor
2013-09-06 09:52:56 +03:00
Mihai Bazon
5d8da864c5
Fix names.
2013-09-02 19:38:00 +03:00
Mihai Bazon
85b527ba3d
Disallow continue referring to a non-IterationStatement. Fix #287
...
Simplifies handling of labels (their definition/references can be easily
figured out at parse time, no need to do it in `figure_out_scope`).
2013-09-02 19:36:16 +03:00
Mihai Bazon
02a84385a0
Don't swap binary ops when "use asm" is in effect.
...
Refs #167
2013-06-07 12:52:09 +03:00
Jake Harding
478bf4dbdd
Add support for enclose option. Closes #139 .
2013-03-24 11:11:23 +02:00