mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
- Compile scene hierarchies, synchronized rotations, and perspective camera transforms. - Support box and buffer geometry, bounds, normals, and index selection. - Preserve JavaScript constructor and callback behavior in native LLVM and WASM builds.
18 lines
659 B
JavaScript
18 lines
659 B
JavaScript
class Base {
|
|
/** @param {boolean} [force] */
|
|
update(force) { console.log('base', force === undefined, force === true); }
|
|
forward(force) { this.update(force); }
|
|
}
|
|
class Child extends Base {
|
|
update(force) { console.log('child', force === undefined, force === false); super.update(force); }
|
|
}
|
|
const base = new Base(), child = new Child();
|
|
base.update(); child.update(); child.update(false); child.forward(true);
|
|
class Defaults {
|
|
run(value = 5) { console.log('default', value); }
|
|
}
|
|
class NoDefault extends Defaults {
|
|
run(value) { console.log('no default', value === undefined); }
|
|
}
|
|
new Defaults().run(); new NoDefault().run(); new NoDefault().run(3);
|