forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for function property assignment generators.
- Loading branch information
1 parent
a5407f9
commit 54781f5
Showing
14 changed files
with
1,698 additions
and
13 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...s/Fidelity/parser/ecmascript6/FunctionPropertyAssignments/FunctionPropertyAssignments1.ts
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 v = { *foo() { } } |
257 changes: 257 additions & 0 deletions
257
...y/parser/ecmascript6/FunctionPropertyAssignments/FunctionPropertyAssignments1.ts.expected
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,257 @@ | ||
{ | ||
"isDeclaration": false, | ||
"languageVersion": "EcmaScript6", | ||
"sourceUnit": { | ||
"kind": "SourceUnit", | ||
"start": 0, | ||
"end": 22, | ||
"width": 22, | ||
"moduleElements": [ | ||
{ | ||
"kind": "VariableStatement", | ||
"start": 0, | ||
"end": 22, | ||
"width": 22, | ||
"variableDeclaration": { | ||
"kind": "VariableDeclaration", | ||
"start": 0, | ||
"end": 22, | ||
"width": 22, | ||
"varKeyword": { | ||
"kind": "VarKeyword", | ||
"fullStart": 0, | ||
"start": 0, | ||
"fullWidth": 3, | ||
"width": 3, | ||
"text": "var", | ||
"value": "var", | ||
"valueText": "var" | ||
}, | ||
"variableDeclarators": [ | ||
{ | ||
"kind": "VariableDeclarator", | ||
"start": 4, | ||
"end": 22, | ||
"width": 18, | ||
"propertyName": { | ||
"kind": "IdentifierName", | ||
"fullStart": 3, | ||
"start": 4, | ||
"fullWidth": 2, | ||
"width": 1, | ||
"text": "v", | ||
"value": "v", | ||
"valueText": "v", | ||
"hasLeadingTrivia": true, | ||
"leadingTrivia": [ | ||
{ | ||
"kind": "WhitespaceTrivia", | ||
"fullStart": 3, | ||
"fullEnd": 4, | ||
"text": " " | ||
} | ||
] | ||
}, | ||
"equalsValueClause": { | ||
"kind": "EqualsValueClause", | ||
"start": 6, | ||
"end": 22, | ||
"width": 16, | ||
"equalsToken": { | ||
"kind": "EqualsToken", | ||
"fullStart": 5, | ||
"start": 6, | ||
"fullWidth": 2, | ||
"width": 1, | ||
"text": "=", | ||
"value": "=", | ||
"valueText": "=", | ||
"hasLeadingTrivia": true, | ||
"leadingTrivia": [ | ||
{ | ||
"kind": "WhitespaceTrivia", | ||
"fullStart": 5, | ||
"fullEnd": 6, | ||
"text": " " | ||
} | ||
] | ||
}, | ||
"value": { | ||
"kind": "ObjectLiteralExpression", | ||
"start": 8, | ||
"end": 22, | ||
"width": 14, | ||
"openBraceToken": { | ||
"kind": "OpenBraceToken", | ||
"fullStart": 7, | ||
"start": 8, | ||
"fullWidth": 2, | ||
"width": 1, | ||
"text": "{", | ||
"value": "{", | ||
"valueText": "{", | ||
"hasLeadingTrivia": true, | ||
"leadingTrivia": [ | ||
{ | ||
"kind": "WhitespaceTrivia", | ||
"fullStart": 7, | ||
"fullEnd": 8, | ||
"text": " " | ||
} | ||
] | ||
}, | ||
"propertyAssignments": [ | ||
{ | ||
"kind": "FunctionPropertyAssignment", | ||
"start": 10, | ||
"end": 20, | ||
"width": 10, | ||
"asterixToken": { | ||
"kind": "AsteriskToken", | ||
"fullStart": 9, | ||
"start": 10, | ||
"fullWidth": 2, | ||
"width": 1, | ||
"text": "*", | ||
"value": "*", | ||
"valueText": "*", | ||
"hasLeadingTrivia": true, | ||
"leadingTrivia": [ | ||
{ | ||
"kind": "WhitespaceTrivia", | ||
"fullStart": 9, | ||
"fullEnd": 10, | ||
"text": " " | ||
} | ||
] | ||
}, | ||
"propertyName": { | ||
"kind": "IdentifierName", | ||
"fullStart": 11, | ||
"start": 11, | ||
"fullWidth": 3, | ||
"width": 3, | ||
"text": "foo", | ||
"value": "foo", | ||
"valueText": "foo" | ||
}, | ||
"callSignature": { | ||
"kind": "CallSignature", | ||
"start": 14, | ||
"end": 16, | ||
"width": 2, | ||
"parameterList": { | ||
"kind": "ParameterList", | ||
"start": 14, | ||
"end": 16, | ||
"width": 2, | ||
"openParenToken": { | ||
"kind": "OpenParenToken", | ||
"fullStart": 14, | ||
"start": 14, | ||
"fullWidth": 1, | ||
"width": 1, | ||
"text": "(", | ||
"value": "(", | ||
"valueText": "(" | ||
}, | ||
"closeParenToken": { | ||
"kind": "CloseParenToken", | ||
"fullStart": 15, | ||
"start": 15, | ||
"fullWidth": 1, | ||
"width": 1, | ||
"text": ")", | ||
"value": ")", | ||
"valueText": ")" | ||
} | ||
} | ||
}, | ||
"block": { | ||
"kind": "Block", | ||
"start": 17, | ||
"end": 20, | ||
"width": 3, | ||
"openBraceToken": { | ||
"kind": "OpenBraceToken", | ||
"fullStart": 16, | ||
"start": 17, | ||
"fullWidth": 2, | ||
"width": 1, | ||
"text": "{", | ||
"value": "{", | ||
"valueText": "{", | ||
"hasLeadingTrivia": true, | ||
"leadingTrivia": [ | ||
{ | ||
"kind": "WhitespaceTrivia", | ||
"fullStart": 16, | ||
"fullEnd": 17, | ||
"text": " " | ||
} | ||
] | ||
}, | ||
"closeBraceToken": { | ||
"kind": "CloseBraceToken", | ||
"fullStart": 18, | ||
"start": 19, | ||
"fullWidth": 2, | ||
"width": 1, | ||
"text": "}", | ||
"value": "}", | ||
"valueText": "}", | ||
"hasLeadingTrivia": true, | ||
"leadingTrivia": [ | ||
{ | ||
"kind": "WhitespaceTrivia", | ||
"fullStart": 18, | ||
"fullEnd": 19, | ||
"text": " " | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"closeBraceToken": { | ||
"kind": "CloseBraceToken", | ||
"fullStart": 20, | ||
"start": 21, | ||
"fullWidth": 2, | ||
"width": 1, | ||
"text": "}", | ||
"value": "}", | ||
"valueText": "}", | ||
"hasLeadingTrivia": true, | ||
"leadingTrivia": [ | ||
{ | ||
"kind": "WhitespaceTrivia", | ||
"fullStart": 20, | ||
"fullEnd": 21, | ||
"text": " " | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"endOfFileToken": { | ||
"kind": "EndOfFileToken", | ||
"fullStart": 22, | ||
"start": 22, | ||
"fullWidth": 0, | ||
"width": 0, | ||
"text": "" | ||
} | ||
}, | ||
"lineMap": { | ||
"lineStarts": [ | ||
0 | ||
], | ||
"length": 22 | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...s/Fidelity/parser/ecmascript6/FunctionPropertyAssignments/FunctionPropertyAssignments2.ts
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 v = { *() { } } |
Oops, something went wrong.