Since classes in ECMAScript 6 is simply syntactical sugar over JavaScript's existing prototype-based inheritance, it is still possible to "extend" (for lack of a better word) the prototype of an existing class with EMCAScript 5 syntax and add methods to it even after the class declaration in a completely separate file.

```
/* Dog.js */

class Dog {
    woof() {
        console.log('woof woof');
    }
}

module.exports = Dog;

/* main.js */

var Dog = require('./Dog');

Dog.prototype.bark = function() {
    console.log('bark bark');
};

var dog = new Dog();
dog.woof(); // 'woof woof'
dog.bark(); // 'bark bark'

```

Is there a way to achieve the same functionality as above, but maintain the ECMAScript 6 class syntax in `main.js` as opposed to going back to the prototype syntax? Trying something such as `class Dog extends Dog` throws an error as the `Dog` class is already declared.

Note that this is not extending in the sense of inheritance, as that would require creating a new class rather than adding methods to an existing class.

```
class Dog {
    woof() {
        console.log('woof woof');
    }
}

class AdvancedDog extends Dog {
    bark() {
        console.log('bark bark');
    }
}

var dog = new Dog();
dog.woof(); // 'woof woof'
dog.bark(); // Error, not what is needed.

```