Increase test coverage (#175)

* Increase test coverage

* Test for error when binding `this` in destructuring pattern

* Ignore coverage of inAsync check in parseAwait - already checked externally

* Ignore coverage of default case in checkPropClash

* Remove unused parameter isAsync from parseParenAndDistinguishExpression

* Ignore coverage of an `else` branch in flowParseTypeParameterDeclaration

* Flow: remove unused parameters to flowParseTypeAnnotatableIdentifier

* Flow: ignore coverage of pass-through throw statement in parseConditional

* Flow: Add test for error on property with type param

* Flow: ignore coverage of pass-through throw statements in parseMaybeAssign, parseArrow

* Add test for error on XML-style comment in module code

* Update test for error on method in object pattern

* Test for error: "Only '=' operator can be used for specifying default value"
This commit is contained in:
Moti Zilberman
2016-10-16 16:04:13 +03:00
committed by Daniel Tschinder
parent 490ae9a44c
commit 7c18bf83cc
38 changed files with 646 additions and 28 deletions

View File

@@ -0,0 +1,4 @@
{
a: switch (i) {
}
}

View File

@@ -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": []
}
}

View File

@@ -0,0 +1,3 @@
switch (x) {
var y = 5;
}

View File

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token (2:2)"
}