-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use correct location data for object initializer members (#144)
Fixes decaffeinate/decaffeinate#778 The end position of the initializer member isn't just the end position of the value, since the value might be wrapped in parens. Instead, I get the location data using `mapBase` like in various other code paths.
- Loading branch information
1 parent
7cd51c3
commit a9a8c5a
Showing
3 changed files
with
102 additions
and
1 deletion.
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 @@ | ||
{a: (b), c} |
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,98 @@ | ||
{ | ||
"type": "Program", | ||
"line": 1, | ||
"column": 1, | ||
"range": [ | ||
0, | ||
12 | ||
], | ||
"raw": "{a: (b), c}\n", | ||
"body": { | ||
"type": "Block", | ||
"line": 1, | ||
"column": 1, | ||
"range": [ | ||
0, | ||
11 | ||
], | ||
"statements": [ | ||
{ | ||
"type": "ObjectInitialiser", | ||
"line": 1, | ||
"column": 1, | ||
"range": [ | ||
0, | ||
11 | ||
], | ||
"members": [ | ||
{ | ||
"type": "ObjectInitialiserMember", | ||
"line": 1, | ||
"column": 2, | ||
"range": [ | ||
1, | ||
7 | ||
], | ||
"key": { | ||
"type": "Identifier", | ||
"line": 1, | ||
"column": 2, | ||
"range": [ | ||
1, | ||
2 | ||
], | ||
"raw": "a", | ||
"data": "a" | ||
}, | ||
"expression": { | ||
"type": "Identifier", | ||
"line": 1, | ||
"column": 6, | ||
"range": [ | ||
5, | ||
6 | ||
], | ||
"raw": "b", | ||
"data": "b" | ||
}, | ||
"raw": "a: (b)" | ||
}, | ||
{ | ||
"type": "ObjectInitialiserMember", | ||
"line": 1, | ||
"column": 10, | ||
"range": [ | ||
9, | ||
10 | ||
], | ||
"key": { | ||
"type": "Identifier", | ||
"line": 1, | ||
"column": 10, | ||
"range": [ | ||
9, | ||
10 | ||
], | ||
"raw": "c", | ||
"data": "c" | ||
}, | ||
"expression": { | ||
"type": "Identifier", | ||
"line": 1, | ||
"column": 10, | ||
"range": [ | ||
9, | ||
10 | ||
], | ||
"raw": "c", | ||
"data": "c" | ||
}, | ||
"raw": "c" | ||
} | ||
], | ||
"raw": "{a: (b), c}" | ||
} | ||
], | ||
"raw": "{a: (b), c}" | ||
} | ||
} |