-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: generator methods in classes (fixes #85)
- Loading branch information
Jamund Ferguson
committed
Mar 10, 2015
1 parent
7e064fe
commit 9eac2ef
Showing
19 changed files
with
434 additions
and
22 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
4 changes: 4 additions & 0 deletions
4
tests/fixtures/ecma-features-mix/classes-and-generators/classes-and-generators.config.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,4 @@ | ||
module.exports = { | ||
classes: true, | ||
generators: true | ||
}; |
153 changes: 153 additions & 0 deletions
153
tests/fixtures/ecma-features-mix/classes-and-generators/classes-and-generators.result.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,153 @@ | ||
module.exports = { | ||
"type": "Program", | ||
"body": [ | ||
{ | ||
"type": "ClassDeclaration", | ||
"id": { | ||
"type": "Identifier", | ||
"name": "Foo", | ||
"range": [ | ||
6, | ||
9 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 6 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 9 | ||
} | ||
} | ||
}, | ||
"superClass": null, | ||
"body": { | ||
"type": "ClassBody", | ||
"body": [ | ||
{ | ||
"type": "MethodDefinition", | ||
"key": { | ||
"type": "Identifier", | ||
"name": "bar", | ||
"range": [ | ||
14, | ||
17 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 5 | ||
} | ||
} | ||
}, | ||
"value": { | ||
"type": "FunctionExpression", | ||
"id": null, | ||
"params": [], | ||
"defaults": [], | ||
"body": { | ||
"type": "BlockStatement", | ||
"body": [], | ||
"range": [ | ||
20, | ||
24 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 8 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 2 | ||
} | ||
} | ||
}, | ||
"rest": null, | ||
"generator": true, | ||
"expression": false, | ||
"range": [ | ||
17, | ||
24 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 2 | ||
} | ||
} | ||
}, | ||
"kind": "method", | ||
"computed": false, | ||
"range": [ | ||
13, | ||
24 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 2 | ||
} | ||
}, | ||
"static": false | ||
} | ||
], | ||
"range": [ | ||
10, | ||
26 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 10 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"column": 1 | ||
} | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
26 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"column": 1 | ||
} | ||
} | ||
} | ||
], | ||
"range": [ | ||
0, | ||
26 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"column": 1 | ||
} | ||
} | ||
}; |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/ecma-features-mix/classes-and-generators/classes-and-generators.src.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,4 @@ | ||
class Foo { | ||
*bar() { | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/ecma-features-mix/classes-and-generators/error-generator.config.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,4 @@ | ||
module.exports = { | ||
classes: true, | ||
generators: false | ||
}; |
6 changes: 6 additions & 0 deletions
6
tests/fixtures/ecma-features-mix/classes-and-generators/error-generator.result.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,6 @@ | ||
module.exports = { | ||
"index": 16, | ||
"lineNumber": 2, | ||
"column": 5, | ||
"description": "Unexpected token *" | ||
}; |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/ecma-features-mix/classes-and-generators/error-generator.src.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,4 @@ | ||
class Foo { | ||
*bar() { | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
tests/fixtures/ecma-features-mix/classes-and-generators/error-no-class.config.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,5 @@ | ||
module.exports = { | ||
classes: false, | ||
objectLiteralShorthandMethods: false, | ||
generators: false | ||
}; |
6 changes: 6 additions & 0 deletions
6
tests/fixtures/ecma-features-mix/classes-and-generators/error-no-class.result.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,6 @@ | ||
module.exports = { | ||
"index": 0, | ||
"lineNumber": 1, | ||
"column": 1, | ||
"description": "Unexpected reserved word" | ||
}; |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/ecma-features-mix/classes-and-generators/error-no-class.src.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,4 @@ | ||
class Foo { | ||
*bar() { | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/ecma-features-mix/classes-and-generators/error-static-no-generators.config.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,4 @@ | ||
module.exports = { | ||
classes: true, | ||
generators: false | ||
}; |
6 changes: 6 additions & 0 deletions
6
tests/fixtures/ecma-features-mix/classes-and-generators/error-static-no-generators.result.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,6 @@ | ||
module.exports = { | ||
"index": 20, | ||
"lineNumber": 2, | ||
"column": 9, | ||
"description": "Unexpected token *" | ||
}; |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/ecma-features-mix/classes-and-generators/error-static-no-generators.src.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,4 @@ | ||
class Foo { | ||
static *bar() { | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/ecma-features-mix/classes-and-generators/static-generators.config.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,4 @@ | ||
module.exports = { | ||
classes: true, | ||
generators: true | ||
}; |
Oops, something went wrong.