Skip to content
This repository was archived by the owner on May 19, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/plugins/jsx/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ pp.jsxParseAttributeValue = function() {
// at the beginning of the next one (right brace).

pp.jsxParseEmptyExpression = function() {
let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc);
return this.finishNodeAt(node, "JSXEmptyExpression", this.start, this.startLoc);
let node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc);
return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc);
};

// Parse JSX spread child
Expand Down
39 changes: 16 additions & 23 deletions test/fixtures/jsx/basic/10/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,20 @@
},
"expression": {
"type": "JSXEmptyExpression",
"loc": {},
"leadingComments": [
"start": 4,
"end": 27,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 27
}
},
"leadingComments": null,
"innerComments": [
{
"type": "CommentBlock",
"value": " this is a comment ",
Expand All @@ -156,26 +168,7 @@
}
}
]
},
"leadingComments": null,
"innerComments": [
{
"type": "CommentBlock",
"value": " this is a comment ",
"start": 4,
"end": 27,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 27
}
}
}
]
}
}
]
}
Expand All @@ -201,4 +194,4 @@
}
}
]
}
}