Files
ladybird/Tests/LibJS/Runtime/custom-@@hasInstance.js
2026-01-22 07:46:48 -05:00

10 lines
258 B
JavaScript

test("basic functionality", () => {
function Foo() {}
Object.defineProperty(Foo, Symbol.hasInstance, {
value: instance => instance === 2,
});
expect(new Foo() instanceof Foo).toBeFalse();
expect(2 instanceof Foo).toBeTrue();
});