Skip to content

Commit

Permalink
Test correct new.target
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Feb 1, 2020
1 parent c409dd8 commit 2fd29af
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"use strict";

let NewTarget;

class A {
constructor() { NewTarget = new.target; }
}
class B extends A {}

new A();
expect(NewTarget).toBe(A);

new B();
expect(NewTarget).toBe(B);

0 comments on commit 2fd29af

Please sign in to comment.