kataan 0.0.4

A high-performance JavaScript engine written in pure Rust. Library, C FFI, and CLI.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*---
description: class extends/super and method override
esid: sec-class-definitions
features: [class]
---*/
class Animal {
  constructor(name) { this.name = name; }
  describe() { return this.name + " makes a sound"; }
}
class Dog extends Animal {
  describe() { return super.describe() + " (woof)"; }
}
assert.sameValue(new Dog("Rex").describe(), "Rex makes a sound (woof)");
assert.sameValue(new Dog("Rex") instanceof Animal, true, "subclass instanceof base");