Files
scriptc/tests/corpus/js-class-shadowed-methods.js
Chris Tate a07998f667 Expand static three.js workflows and host integration (#621)
* Expand static three.js workflows and host integration

* Preserve JavaScript class state in static three.js workflows

* Preserve inferred JavaScript behavior across static workflows

* Preserve inferred callables and native compatibility boundaries

* Retain annotated JavaScript factory exports and bootstrap-safe call spreads

* Preserve Buffer and child callback identities in static packages

* Clarify JavaScript symbol spread support
2026-10-02 19:56:34 -05:00

33 lines
746 B
JavaScript

class C {
constructor() {
this.foo = () => {
console.log("called arrow");
};
}
foo() {
console.log("called method");
}
}
class D extends C {
foo() {
console.log("SUPER:");
super.foo();
console.log("THIS:");
this.foo();
}
}
const obj = new D();
obj.foo();
D.prototype.foo.call(obj);
class NonCallable {
constructor() { this.m = 'not callable'; }
m() { console.log('unreached'); }
}
try { new NonCallable().m(); } catch (error) { console.log(error.name, error.message.includes('is not a function')); }
class Clean { foo() { return 4; } }
class Callable extends Clean { constructor() { super(); this.foo = () => 3; } }
console.log(new Callable().foo(), Clean.prototype.foo.call(new Callable()));