function-class-extended.js 208 B

1234567891011121314151617
  1. "use strict";
  2. const targets = [];
  3. function Foo() {
  4. targets.push(new.target);
  5. }
  6. function Bar() {
  7. Foo.call(this);
  8. }
  9. new Foo;
  10. new Bar();
  11. expect(targets[0]).toBe(Foo);
  12. expect(targets[1]).toBeUndefined();