swc/crates/swc_estree_compat/tests/fixtures/class-extends/input.js

20 lines
292 B
JavaScript
Raw Normal View History

class Animal {
constructor(name) {
this.name = name;
}
speak() {
console.log(`${this.name} makes a noise.`);
}
}
class Dog extends Animal {
constructor(name) {
super(name);
}
speak() {
console.log(`${this.name} barks.`);
}
}