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 Sep 9, 2018
1 parent 450aae7 commit 072d362
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 072d362

Please sign in to comment.