Anthony Van de Gejuchte
85fbf86d7b
Keep master in sync with harmony
...
* Do not mangle when no mangle is required
* Improve use_asm reset while printing code
2016-06-20 18:42:17 +02:00
Shrey Banga
e645ba84cf
Respect quote style in object literals
...
The option added in fbbaa42ee5 wasn't
being respected inside object literals, so quoted property names would
still be stripped out with this option.
This is mostly a corner-case, but useful when the output is passed to
something like the Closure compiler, where quoted property names can be
used to prevent mangling.
2016-06-19 21:13:31 +02:00
Anthony Van de Gejuchte
2149bfb707
Don't mix strings with directives in output
...
* Don't interpret strings with escaped content as directive
* Don't interpret strings after empty statement as directive
* Adapt output to prevent strings being represent as directive
* Introduce UGLIFY_DEBUG to allow internal testing like EXPECT_DIRECTIVE
2016-06-19 20:59:17 +02:00
Anthony Van de Gejuchte
f9cab7ad61
Allow expand in array literals
2016-06-19 20:49:18 +02:00
Anthony Van de Gejuchte
5c4cfaa0a7
Re-add parens after new expression in beautify mode
2016-06-12 20:03:48 +02:00
Richard van Velzen
0a3d780327
Merge branch 'master' into harmony
2016-06-12 17:29:42 +02:00
Anthony Van de Gejuchte
6c8e001fee
Stop dropping args in new expressions
2016-06-12 17:17:17 +02:00
David Bau
f99b7b630d
Escape null characters as \0 unless followed by 0-7.
2016-06-12 14:32:32 +02:00
Richard van Velzen
fa29344781
Merge branch 'master' into harmony
2016-06-09 22:29:52 +02:00
Anthony Van de Gejuchte
dcfc514c38
Improve yield support and restrict usage of strict
...
- Partially reverting 91cdb93e57 and eaf3911c31 and reimplement
- Add generators support for objects and classes
- Only classes can have static methods so restrict use of it
Special thanks to @rvanvelzen and @kzc for reviewing this patch and
providing constructive feedback over and over again.
2016-06-09 22:22:15 +02:00
Anthony Van de Gejuchte
8287ef6781
Fix uglify attempting to rewrite invalid new expressions
2016-06-08 19:45:21 +02:00
Richard van Velzen
e36e07fa77
Merge branch 'master' into harmony
2016-05-04 20:13:35 +02:00
kzc
a0e03c9df4
Retain comments before AST_Constants during mangle.
2016-05-04 20:11:45 +02:00
not-an-aardvark
5b893c8ec3
Avoid syntax error in yield assignments ( fixes #1054 )
2016-04-25 19:14:44 -04:00
Richard van Velzen
f94497d1d6
Merge branch 'master' into harmony
2016-04-18 15:50:35 +02:00
Darío Javier Cravero
91cdb93e57
Implement harmony generators and yield
...
Uses #716 's implementation and adds tests.
Fixes #716 .
2016-04-13 14:22:08 +02:00
kzc
07bb7262d0
Escape all ASCII control characters within strings when using ascii_only.
...
Fixes #1017 .
Tab characters within strings are now output as `\t` in all output modes.
2016-03-24 11:51:54 -04:00
Fábio Santos
6d2f77c180
fix #1003 by removing AST_ObjectSymbol and using AST_ObjectKeyVal for the same effect
2016-03-14 13:42:50 +01:00
Fábio Santos
ce84a706a3
Implement the export statement
2016-03-14 12:54:05 +01:00
Fábio Santos
86b5248837
Mangling externally imported names by using aliasing
2016-03-14 12:54:05 +01:00
Fábio Santos
59e1601fb8
importing names in the modules, not just default imports
2016-03-14 12:54:05 +01:00
Fábio Santos
d35a9e7839
Importing names from places
2016-03-14 12:54:05 +01:00
Fábio Santos
0465bd270d
Starting out the import statement
2016-03-14 12:54:05 +01:00
philippsimon
ee6c9fabb7
Fix: Uglified Number.prototype functions on big numbers
2016-03-14 12:41:06 +01:00
Fábio Santos
7a8cffd631
Move the idea of a symbol having a default value up the class chain.
2016-01-19 19:22:22 +01:00
Fábio Santos
5b553aafe2
Destructuring parameters with defaults. function x({ foo, bar } = {}) { }
2016-01-19 19:22:22 +01:00
Fábio Santos
084437bc6d
Non-destructuring default parameters
2016-01-19 19:22:22 +01:00
Anthony Van de Gejuchte
70e5b6f15b
Add some tests for comment-filters through api
...
Also never bother comment options to filter comment5/shebang comments
as they have their custom filter.
2016-01-19 19:14:19 +01:00
Richard van Velzen
7f3dbb6df7
Merge branch 'master' into harmony
2015-12-26 17:59:38 +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
Fábio Santos
a800356ad0
Implement new.target
2015-11-21 14:48:23 +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
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
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
0d8dea9538
start concise methods
2015-10-27 09:31:16 +01: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