Files
scriptc/tests/corpus/js-specialized-field-method.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

9 lines
347 B
JavaScript

class Vector { constructor(x = 0) { this.x = x; } dot(other) { return this.x * other.x; } }
class Plane { constructor() { this.normal = new Vector(2); } }
class Ray {
constructor() { this.direction = new Vector(3); }
distance(plane) { return plane.normal.dot(this.direction); }
}
const ray = new Ray();
console.log(ray.distance(new Plane()));