This repository has been archived by the owner on May 19, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow new.target in class properties (#759)
- Loading branch information
1 parent
60ea39a
commit b5e6ba6
Showing
11 changed files
with
2,333 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/fixtures/es2015/meta-properties/new-target-invalid/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "new.target can only be used in functions (1:4)" | ||
"throws": "new.target can only be used in functions (1:0)" | ||
} |
2 changes: 1 addition & 1 deletion
2
test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "new.target can only be used in functions (1:12)" | ||
"throws": "new.target can only be used in functions (1:8)" | ||
} |
1 change: 1 addition & 0 deletions
1
test/fixtures/experimental/class-properties/new-target-invalid/actual.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
var x = new.target; |
4 changes: 4 additions & 0 deletions
4
test/fixtures/experimental/class-properties/new-target-invalid/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"plugins": ["classProperties"], | ||
"throws": "new.target can only be used in functions or class properties (1:8)" | ||
} |
10 changes: 10 additions & 0 deletions
10
test/fixtures/experimental/class-properties/new-target-with-flow/actual.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class X { | ||
static a = new.target; | ||
static b = (foo = 1 + bar(new.target)); | ||
static c = () => new.target; | ||
static d = (foo = new.target) => {}; | ||
e = new.target; | ||
f = (foo = 1 + bar(new.target)); | ||
g = () => new.target; | ||
h = (foo = new.target) => {}; | ||
} |
Oops, something went wrong.