Anthony Van de Gejuchte
6f3e35bb3f
Fix ch that could contain other newline characters
2015-12-27 22:24:37 +01:00
Richard van Velzen
7f3dbb6df7
Merge branch 'master' into harmony
2015-12-26 17:59:38 +01:00
Anthony Van de Gejuchte
174404c0f3
Do not allow newlines in string literals
2015-12-26 15:08:37 +01:00
Richard van Velzen
60c4030a4d
Merge pull request #874 from kzc/fix-conditionals
...
#873 Fix `conditionals` optimizations with default compress options
2015-12-26 14:28:33 +01:00
Anthony Van de Gejuchte
bd99b00413
Semicolon after do...while statement is optional
2015-12-17 23:02:35 +01:00
Richard van Velzen
e4d73d8b7c
Merge pull request #870 from fabiosantoscode/feature/harmony-class
...
Harmony: classes
2015-12-07 18:59:07 +01:00
kzc
774bda13cd
#873 Fix conditionals optimizations with default compress options
2015-11-24 13:27:50 -05:00
Fábio Santos
a800356ad0
Implement new.target
2015-11-21 14:48:23 +00:00
Fábio Santos
e076abdbf2
Mangle class names correctly
2015-11-21 13:59:18 +00:00
Fábio Santos
425613b0d2
mangle class names
2015-11-21 12:20:20 +00:00
Fábio Santos
69da8e53e0
Separate class expressions from class declarations and their symbols like defuns
2015-11-21 09:17:32 +00:00
Fábio Santos
bb6b3a773a
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.
2015-11-20 19:34:10 +00:00
Mihai Bazon
7f48d5b33c
Fix endless loop
...
Close #866
2015-11-16 12:08:24 +02:00
Mihai Bazon
b6968b6bd2
Limit max iterations for tighten_body
...
Ref #866
2015-11-16 12:08:24 +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
c898a26117
Build label def/refs info when figuring out scope
...
Fix #862
2015-11-12 11:48:06 +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
Mihai Bazon
3c4346728e
Merge pull request #854 from kzc/moz-regexp-2
...
Have mozilla AST RegExpLiteral parser use regex.pattern and regex.flags
2015-11-10 10:12:30 +02:00
Mihai Bazon
18d37ac761
Fix parsing invalid input
...
i.e. `x = 1.xe` — because parseFloat("1.xe") returns 1, this parsed as
`x = 1`.
Ref #857
2015-11-09 13:15:20 +02:00
Richard van Velzen
63d35f8f6d
Prevent ReDoS by not using a regexp to verify floating point numbers
...
`parseFloat` will return `NaN` for invalid numbers anyway, which is the check used to throw the parse error.
Fixes #857
2015-11-09 11:28:27 +01:00
kzc
7dbe961b2d
simplify mozilla AST RegExpLiteral token parse and handle corner cases of regex.pattern better
2015-11-02 13:10:37 -05:00
kzc
94c4daaf9e
Have mozilla AST RegExpLiteral parser use regex.pattern and regex.flags rather than non-standard raw property.
2015-11-02 12:24:09 -05:00
kzc
37ee9de902
rename To_Moz_Literal to To_Moz_RegExp
2015-11-01 10:20:42 -05:00
kzc
83db98ad3b
Fixed RegExp literal in mozilla AST generation/output and added a --dump-spidermonkey-ast flag
2015-11-01 01:02:52 -04:00
kzc
bd0ae6569f
return undefined optimization no longer uses return_void_0 option
2015-10-29 08:19:12 +01:00
kzc
7491d07666
optimize return undefined and return void 0
2015-10-29 08:19:12 +01:00
Richard van Velzen
335e349314
Allow specification beautify options in tests
...
Caught an error in #847 as well - `output` wasn't passed anywhere which led to an exception. `options` was available though.
2015-10-28 20:50:01 +01:00
Richard van Velzen
392ac4ff31
Merge branch 'master' into harmony
2015-10-28 20:38:07 +01:00
Michael Ficarra
a887cde9f2
fixes #845 : \v escaping should be restricted to "screw_ie8" mode
2015-10-27 09:05:21 -07:00
Fábio Santos
9ffed2bea6
static properties
2015-10-27 12:24:37 +00:00
Fábio Santos
5f7cb6939c
Starting ES6 classes
2015-10-27 12:24:37 +00:00
Fábio Santos
64e7a00399
Accept keyword names as concise method names
2015-10-27 09:31:16 +01:00
Fábio Santos
c99eaae360
Make concise methods work with propmangle
2015-10-27 09:31:16 +01:00
Fábio Santos
34213ea2f8
Create a new symbol for methods' names
2015-10-27 09:31:16 +01:00
Fábio Santos
0d8dea9538
start concise methods
2015-10-27 09:31:16 +01:00
Fábio Santos
2cce61c564
Allow 'of' to be a name.
2015-10-26 20:56:59 +00:00
Richard van Velzen
246ec416c0
Merge branch 'master' into harmony
2015-10-20 21:58:58 +02:00
Fábio Santos
b5623b19d4
Fix #836
2015-10-20 19:48:56 +01:00
Richard van Velzen
6be9c752d5
Merge branch 'master' into harmony
2015-10-20 20:12:10 +02:00
startswithaj
6b2861e086
Make_string was missing \v and wasnt reversing vertical tabs even though read_escaped_char coverts them
2015-10-15 17:42:16 +10:00
kzc
dff54a6552
Fix other operator output related to <!-- or -->
2015-10-13 01:17:10 -04:00
Fábio Santos
b31918bbf0
computed properties
2015-10-12 21:38:20 +01:00
Mihai Bazon
17eef5a3c2
Only encode <!-- and --> in strings when inline_script
2015-10-12 10:21:22 +03:00
kzc
9f1f21b810
Output -- > instead of --> in expressions. Escape <!-- and --> within string literals.
2015-10-12 10:19:17 +03:00
Richard van Velzen
b14496c742
Merge branch 'master' into harmony
...
Conflicts:
lib/compress.js
2015-10-12 08:54:44 +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
kzc
593677d2ff
Add proper support for "use asm"; blocks. Disable -c optimization within "use asm"; sections and preserve floating point literals in their original form. Non-asm.js sections are optimized as before. Asm.js sections can still be mangled and minified of whitespace. No special command line flags are required.
2015-10-07 10:00:28 +02:00
Anthony Van de Gejuchte
c69294c449
Implement shebang support
2015-10-06 22:35:45 +02:00
Mihai Bazon
6637c267a5
Fix mozilla-ast after module loading changes
...
Need to explicitly qualify stuff now, since it's not evaluated in some
global scope.
Ref #636
2015-09-24 18:13:21 +03: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