Skip to content

Commit

Permalink
Add tests for function property assignment generators.
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrusNajmabadi committed Nov 12, 2014
1 parent a5407f9 commit 54781f5
Show file tree
Hide file tree
Showing 14 changed files with 1,698 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var v = { *foo() { } }
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
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var v = { *() { } }
Loading

0 comments on commit 54781f5

Please sign in to comment.