Skip to content

Commit

Permalink
add testcases on new.target
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Feb 2, 2021
1 parent de8d14b commit 5556ac0
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 0 deletions.
@@ -0,0 +1,10 @@
class Base {
constructor() {
this.Foo = class {
static {
this.foo = new.target;
}
}
}
}
expect((new Base).Foo.foo).toBe(undefined);
@@ -0,0 +1,10 @@
class Base {
constructor() {
this.Foo = class {
static {
this.foo = new.target;
}
}
}
}
expect((new Base).Foo.foo).toBe(undefined);
@@ -0,0 +1,12 @@
class Base {
constructor() {
this.Foo = class {
static #_ = (() => {
this.foo = new.target;
})();
};
}

}

expect(new Base().Foo.foo).toBe(undefined);
@@ -0,0 +1,10 @@
class Base {
constructor() {
this.Foo = class {
static {
this.foo = new.target;
}
}
}
}
expect((new Base).Foo.foo).toBe(undefined);
@@ -0,0 +1,10 @@
class Base {
constructor() {
this.Foo = class {
static {
this.foo = new.target;
}
}
}
}
expect((new Base).Foo.foo).toBe(undefined);
@@ -0,0 +1,10 @@
class Base {
constructor() {
this.Foo = class {
static {
this.foo = new.target;
}
}
}
}
expect((new Base).Foo.foo).toBe(undefined);
@@ -0,0 +1,11 @@
class Base {
constructor() {
this.Foo = class {
static {
// fixme: new.target should be undefined after transformed
this.foo = new.target;
}
}
}
}
expect((new Base).Foo.foo).toBe(undefined);

0 comments on commit 5556ac0

Please sign in to comment.