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 Jan 1, 2020
1 parent 886bcb3 commit 58c5857
Showing 1 changed file with 14 additions and 0 deletions.
@@ -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 58c5857

Please sign in to comment.