forked from babel/babylon
-
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.
- Loading branch information
1 parent
dc87d99
commit de84728
Showing
5 changed files
with
763 additions
and
2 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
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,2 @@ | ||
<div foo.bar/>; | ||
<div foo.bar="baz"></div> |
341 changes: 341 additions & 0 deletions
341
test/fixtures/jsx/basic/attribute-expression/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,341 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 41, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 25 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 41, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 25 | ||
} | ||
}, | ||
"sourceType": "script", | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start": 0, | ||
"end": 15, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 15 | ||
} | ||
}, | ||
"expression": { | ||
"type": "JSXElement", | ||
"start": 0, | ||
"end": 14, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 14 | ||
} | ||
}, | ||
"openingElement": { | ||
"type": "JSXOpeningElement", | ||
"start": 0, | ||
"end": 14, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 14 | ||
} | ||
}, | ||
"attributes": [ | ||
{ | ||
"type": "JSXAttribute", | ||
"start": 5, | ||
"end": 12, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 12 | ||
} | ||
}, | ||
"name": { | ||
"type": "JSXMemberExpression", | ||
"start": 5, | ||
"end": 12, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 12 | ||
} | ||
}, | ||
"object": { | ||
"type": "JSXIdentifier", | ||
"start": 5, | ||
"end": 8, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
}, | ||
"name": "foo" | ||
}, | ||
"property": { | ||
"type": "JSXIdentifier", | ||
"start": 9, | ||
"end": 12, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 9 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 12 | ||
} | ||
}, | ||
"name": "bar" | ||
} | ||
}, | ||
"value": null | ||
} | ||
], | ||
"name": { | ||
"type": "JSXIdentifier", | ||
"start": 1, | ||
"end": 4, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 4 | ||
} | ||
}, | ||
"name": "div" | ||
}, | ||
"selfClosing": true | ||
}, | ||
"closingElement": null, | ||
"children": [] | ||
} | ||
}, | ||
{ | ||
"type": "ExpressionStatement", | ||
"start": 16, | ||
"end": 41, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 25 | ||
} | ||
}, | ||
"expression": { | ||
"type": "JSXElement", | ||
"start": 16, | ||
"end": 41, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 25 | ||
} | ||
}, | ||
"openingElement": { | ||
"type": "JSXOpeningElement", | ||
"start": 16, | ||
"end": 35, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 19 | ||
} | ||
}, | ||
"attributes": [ | ||
{ | ||
"type": "JSXAttribute", | ||
"start": 21, | ||
"end": 34, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 18 | ||
} | ||
}, | ||
"name": { | ||
"type": "JSXMemberExpression", | ||
"start": 21, | ||
"end": 28, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 12 | ||
} | ||
}, | ||
"object": { | ||
"type": "JSXIdentifier", | ||
"start": 21, | ||
"end": 24, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 8 | ||
} | ||
}, | ||
"name": "foo" | ||
}, | ||
"property": { | ||
"type": "JSXIdentifier", | ||
"start": 25, | ||
"end": 28, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 9 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 12 | ||
} | ||
}, | ||
"name": "bar" | ||
} | ||
}, | ||
"value": { | ||
"type": "StringLiteral", | ||
"start": 29, | ||
"end": 34, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 13 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 18 | ||
} | ||
}, | ||
"extra": { | ||
"rawValue": "baz", | ||
"raw": "\"baz\"" | ||
}, | ||
"value": "baz" | ||
} | ||
} | ||
], | ||
"name": { | ||
"type": "JSXIdentifier", | ||
"start": 17, | ||
"end": 20, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 4 | ||
} | ||
}, | ||
"name": "div" | ||
}, | ||
"selfClosing": false | ||
}, | ||
"closingElement": { | ||
"type": "JSXClosingElement", | ||
"start": 35, | ||
"end": 41, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 19 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 25 | ||
} | ||
}, | ||
"name": { | ||
"type": "JSXIdentifier", | ||
"start": 37, | ||
"end": 40, | ||
"loc": { | ||
"start": { | ||
"line": 2, | ||
"column": 21 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 24 | ||
} | ||
}, | ||
"name": "div" | ||
} | ||
}, | ||
"children": [] | ||
} | ||
} | ||
], | ||
"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,2 @@ | ||
<div foo:bar/>; | ||
<div foo.bar:biz.baz="value"></div> |
Oops, something went wrong.