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
at AST_Node.eval [as unmangleable] (eval at <anonymous> (/Users/craverod/opensource/panels/panels/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:4041:27)
at Object.eval [as visit] (eval at <anonymous> (/Users/craverod/opensource/panels/panels/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:4214:53)
at Object.TreeWalker._visit (eval at <anonymous> (/Users/craverod/opensource/panels/panels/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:1493:24)
at AST_Node.DEFNODE._walk (eval at <anonymous> (/Users/craverod/opensource/panels/panels/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:415:24)
at AST_Node.eval (eval at <anonymous> (/Users/craverod/opensource/panels/panels/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:775:38)
at Object.TreeWalker._visit (eval at <anonymous> (/Users/craverod/opensource/panels/panels/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:1497:21)
at AST_Node.DEFNODE._walk (eval at <anonymous> (/Users/craverod/opensource/panels/panels/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:774:24)
at eval (eval at <anonymous> (/Users/craverod/opensource/panels/panels/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:1303:22)
at Array.forEach (native)
at AST_Node.eval (eval at <anonymous> (/Users/craverod/opensource/panels/panels/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:1302:29)
```
This PR sorts it out (it gives me: `class Foo{bar(){}}`) but it feels like the wrong hack.
I don't know what's best and whether we can even try to mangle the method or not, mainly because
it's the classes' external API and doing so would prevent others from using it outside the minified
source.
Thoughts?
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.
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