Commit Graph

563 Commits

Author SHA1 Message Date
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
viclm
0e230169f8 Fix eager parsing of arrow functions for non-punc tokens 2016-03-22 11:43:58 +02:00
Darío Javier Cravero
627083fa16 fix: don't fail if definition is undefined
Running `uglifyjs --verbose --compress --mangle --screw-ie8 class.js`
with
`class.js`:
```
class Foo {
  bar() {
  }
}
```
Fails with:
```
undefined:4041
  return this.definition().unmangleable(options);
TypeError: Cannot read property 'unmangleable' of undefined
...
```
2016-03-22 11:43:57 +02:00
Fábio Santos
c5cf25e077 Fix #931: Create arrow functions in maybe_assign so that they can be used in assignments 2016-03-22 11:43:57 +02:00
Fugiman
de5fb76d94 Remove duplicate error message 2016-03-22 11:43:57 +02:00
Fugiman
e457f7aab5 Fix template string parsing 2016-03-22 11:43:57 +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
6c87242d63 Default values inside destructurings 2016-03-22 11:42:34 +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
89dfbfd46b Mangle class names correctly 2016-03-22 11:42:34 +02:00
Fábio Santos
805e027ab8 mangle class names 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
44ecbdf5f0 Accept keyword names as concise method names 2016-03-22 11:41:01 +02:00
Fábio Santos
858d763e62 Make concise methods work with propmangle 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
5e1c89db44 Allow 'of' to be a name. 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
a92a14d171 Remove unused state variable in_parameters, and also remove unreachable code (try_an_object always returned an object!) 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
a54b64d660 What about --mangle-props being on and --mangle being off? 2016-03-22 11:41:00 +02:00
Fábio Santos
2d74aca46a play nice with propmangle 2016-03-22 11:41:00 +02:00
Fábio Santos
cfb1b5d848 Starting destructuring expressions 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
a170ad9d0d Destructuring vardef in for..of and for..in 2016-03-22 11:41:00 +02:00
Fábio Santos
d757202b74 Do not mangle a name if it is in a destructuring vardef. 2016-03-22 11:41:00 +02:00
Fábio Santos
a3a4ae5ef8 Add holes in destructuring defs, also make them nestable 2016-03-22 11:40:44 +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
16e928348b prepare AST_Destructuring for the Ents 2016-03-22 11:40:44 +02:00
Fábio Santos
ebd0682376 Add new-style octal literals and make the B and the O case insensitive. 2016-03-22 11:40:44 +02:00
Fábio Santos
ac1d3f0e88 remove Symbol's argument when we're unsafe and it's undeclared 2016-03-22 11:40:44 +02:00
Fábio Santos
6f93a8d4a1 Fix evaluating the typeof an arrow function. Using evaluate on used to cause a crash. 2016-03-22 11:40:44 +02:00
Fábio Santos
a4d6ed076a Parse binary number literals 2016-03-22 11:40:44 +02:00
Fábio Santos
0a4270b358 Super! 2016-03-22 11:40:26 +02:00