Files
scriptc/tests/corpus/js-dormant-overrides.js
Chris Tate 537ea4d28d Compile three.js spatial queries and vertex attributes
- Support published three.js rotations, bounds, ray intersections, culling, and vertex attributes on native and WASM targets without a JavaScript engine.
- Preserve JavaScript class defaults, data descriptors, and captured loop bindings in static code.
- Handle typed-array input unions and constructor identities while keeping unsupported method overrides explicit.
2026-09-29 21:51:28 -05:00

12 lines
455 B
JavaScript

class Shape {
constructor(size = 1) { this.size = size; }
copy(source, recursive = true) { return source.size + (recursive ? 1 : 0); }
area() { return this.size * this.size; }
}
class ColoredShape extends Shape {
constructor(size = 1) { super(size); this.color = 'red'; }
copy(source, recursive) { return source.size + (recursive ? 1 : 0); }
}
const shape = new ColoredShape(3);
console.log(shape.area(), shape.color, new Shape(2).copy(shape));