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
...
```
This commit is contained in:
committed by
Richard van Velzen
parent
d7ec2ecc12
commit
0b303379c0
@@ -350,7 +350,8 @@ AST_Scope.DEFMETHOD("references", function(sym){
|
||||
});
|
||||
|
||||
AST_Symbol.DEFMETHOD("unmangleable", function(options){
|
||||
return this.definition().unmangleable(options);
|
||||
var def = this.definition();
|
||||
return def && def.unmangleable(options);
|
||||
});
|
||||
|
||||
// property accessors are not mangleable
|
||||
|
||||
Reference in New Issue
Block a user