Debian Codegraph @

packages/babel-plugin-transform-classes/test/fixtures/spec/super-proto-modifications/exec.js

raw
1 var A_called = false;
2 var X_called = false;
3
4 class A { constructor() { A_called = true } }
5 class X { constructor() { X_called = true } }
6 class B extends A {}
7
8 B.prototype.__proto__ = X.prototype;
9 B.__proto__ = X;
10
11 expect(new B() instanceof B).toBe(true);
12 expect(new B() instanceof A).toBe(false);
13 expect(new B() instanceof X).toBe(true);
14 expect(A_called).toBe(false);
15 expect(X_called).toBe(true);