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
Increase test coverage #175
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
39912dc
Increase test coverage
motiz88 f0c916f
Merge branch 'master' of https://github.com/babel/babylon into increa…
motiz88 d4f41c0
Test for error when binding `this` in destructuring pattern
motiz88 93be5eb
Ignore coverage of inAsync check in parseAwait - already checked exte…
motiz88 00a3f77
Ignore coverage of default case in checkPropClash
motiz88 a56ecdf
Remove unused parameter isAsync from parseParenAndDistinguishExpression
motiz88 b62ff21
Ignore coverage of an `else` branch in flowParseTypeParameterDeclaration
motiz88 b5e5c6e
Flow: remove unused parameters to flowParseTypeAnnotatableIdentifier
motiz88 31acda5
Flow: ignore coverage of pass-through throw statement in parseConditi…
motiz88 57dbe3f
Flow: Add test for error on property with type param
motiz88 c3bc01e
Flow: ignore coverage of pass-through throw statements in parseMaybeA…
motiz88 ca869cc
Add test for error on XML-style comment in module code
motiz88 a8fdbc5
Update test for error on method in object pattern
motiz88 9c56e74
Test for error: "Only '=' operator can be used for specifying default…
motiz88 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 @@ | ||
{ | ||
a: switch (i) { | ||
} | ||
} |
117 changes: 117 additions & 0 deletions
117
test/fixtures/core/categorized/label-kind-switch/expected.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,117 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 25, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"column": 1 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 25, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"column": 1 | ||
} | ||
}, | ||
"sourceType": "script", | ||
"body": [ | ||
{ | ||
"type": "BlockStatement", | ||
"start": 0, | ||
"end": 25, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"column": 1 | ||
} | ||
}, | ||
"body": [ | ||
{ | ||
"type": "LabeledStatement", | ||
"start": 4, | ||
"end": 23, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 3 | ||
} | ||
}, | ||
"body": { | ||
"type": "SwitchStatement", | ||
"start": 7, | ||
"end": 23, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 3 | ||
} | ||
}, | ||
"discriminant": { | ||
"type": "Identifier", | ||
"start": 15, | ||
"end": 16, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 13 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 14 | ||
}, | ||
"identifierName": "i" | ||
}, | ||
"name": "i" | ||
}, | ||
"cases": [] | ||
}, | ||
"label": { | ||
"type": "Identifier", | ||
"start": 4, | ||
"end": 5, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 3 | ||
}, | ||
"identifierName": "a" | ||
}, | ||
"name": "a" | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
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,3 @@ | ||
switch (x) { | ||
var y = 5; | ||
} |
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,3 @@ | ||
{ | ||
"throws": "Unexpected token (2:2)" | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/es2015/class-methods/direct-super-outside-constructor/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,3 @@ | ||
class A { | ||
x () {super()} | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/es2015/class-methods/direct-super-outside-constructor/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,3 @@ | ||
{ | ||
"throws": "super() outside of class constructor (2:8)" | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/es2015/class-methods/disallow-static-prototype/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,3 @@ | ||
class A { | ||
static prototype() {} | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/es2015/class-methods/disallow-static-prototype/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,3 @@ | ||
{ | ||
"throws": "Classes may not have static property named prototype (2:9)" | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/es2015/class-methods/getter-signature/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,3 @@ | ||
class A { | ||
get prop (arg) {} | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/es2015/class-methods/getter-signature/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,3 @@ | ||
{ | ||
"throws": "getter should have no params (2:2)" | ||
} |
5 changes: 5 additions & 0 deletions
5
test/fixtures/es2015/class-methods/malformed-super-expression/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,5 @@ | ||
class A { | ||
x () { | ||
super - 1; | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/es2015/class-methods/malformed-super-expression/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,3 @@ | ||
{ | ||
"throws": "Unexpected token (3:10)" | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/es2017/async-functions/no-constructor/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,3 @@ | ||
class A { | ||
async constructor() {} | ||
} |
3 changes: 3 additions & 0 deletions
3
test/fixtures/es2017/async-functions/no-constructor/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,3 @@ | ||
{ | ||
"throws": "Constructor can't be an async function (2:8)" | ||
} |
1 change: 1 addition & 0 deletions
1
test/fixtures/experimental/no-async-generators/error-without-plugin/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 @@ | ||
async function * f () {} |
4 changes: 4 additions & 0 deletions
4
test/fixtures/experimental/no-async-generators/error-without-plugin/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 @@ | ||
{ | ||
"throws": "Unexpected token (1:15)", | ||
"plugins": [] | ||
} |
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 @@ | ||
<A>💩</A> |
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,147 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 16, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 16 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 16, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 16 | ||
} | ||
}, | ||
"sourceType": "script", | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start": 0, | ||
"end": 16, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 16 | ||
} | ||
}, | ||
"expression": { | ||
"type": "JSXElement", | ||
"start": 0, | ||
"end": 16, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 16 | ||
} | ||
}, | ||
"openingElement": { | ||
"type": "JSXOpeningElement", | ||
"start": 0, | ||
"end": 3, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 3 | ||
} | ||
}, | ||
"attributes": [], | ||
"name": { | ||
"type": "JSXIdentifier", | ||
"start": 1, | ||
"end": 2, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 2 | ||
} | ||
}, | ||
"name": "A" | ||
}, | ||
"selfClosing": false | ||
}, | ||
"closingElement": { | ||
"type": "JSXClosingElement", | ||
"start": 12, | ||
"end": 16, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 12 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 16 | ||
} | ||
}, | ||
"name": { | ||
"type": "JSXIdentifier", | ||
"start": 14, | ||
"end": 15, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 15 | ||
} | ||
}, | ||
"name": "A" | ||
} | ||
}, | ||
"children": [ | ||
{ | ||
"type": "JSXText", | ||
"start": 3, | ||
"end": 12, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 3 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 12 | ||
} | ||
}, | ||
"extra": null, | ||
"value": "" | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
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 @@ | ||
<A>f4a9;</A> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was never triggered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah,
method.static
hinges onthis.match(tt.name)
andisGenerator
(subsequently) onthis.eat(tt.star)
. So they are mutually exclusive.