-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed parsing of spread operator inside objects defined in arrow func…
…tions body. Fixes #38
- Loading branch information
Showing
5 changed files
with
476 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
9 changes: 9 additions & 0 deletions
9
test/Peast/Syntax/ES2018/files/ObjectBinding/Spread2.Render.txt
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,9 @@ | ||
const foo = () => ({ | ||
...(void 0) | ||
}); | ||
/**************************************************/ | ||
const foo=()=>({...(void 0)}); | ||
/**************************************************/ | ||
const foo = ( ) => ( { | ||
...( void 0 ) | ||
} ); |
258 changes: 258 additions & 0 deletions
258
test/Peast/Syntax/ES2018/files/ObjectBinding/Spread2.Tokens.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,258 @@ | ||
[ | ||
{ | ||
"type": "Keyword", | ||
"value": "const", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 0, | ||
"index": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 5, | ||
"index": 5 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Identifier", | ||
"value": "foo", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 6, | ||
"index": 6 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 9, | ||
"index": 9 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "=", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 10, | ||
"index": 10 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 11, | ||
"index": 11 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "(", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 12, | ||
"index": 12 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 13, | ||
"index": 13 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": ")", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 13, | ||
"index": 13 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 14, | ||
"index": 14 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "=>", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 15, | ||
"index": 15 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 17, | ||
"index": 17 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "(", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 18, | ||
"index": 18 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 19, | ||
"index": 19 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "{", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 19, | ||
"index": 19 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 20, | ||
"index": 20 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "...", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 20, | ||
"index": 20 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 23, | ||
"index": 23 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "(", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 23, | ||
"index": 23 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 24, | ||
"index": 24 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Keyword", | ||
"value": "void", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 24, | ||
"index": 24 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 28, | ||
"index": 28 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Numeric", | ||
"value": "0", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 29, | ||
"index": 29 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 30, | ||
"index": 30 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": ")", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 30, | ||
"index": 30 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 31, | ||
"index": 31 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "}", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 31, | ||
"index": 31 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 32, | ||
"index": 32 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": ")", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 32, | ||
"index": 32 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 33, | ||
"index": 33 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": ";", | ||
"location": { | ||
"start": { | ||
"line": 1, | ||
"column": 33, | ||
"index": 33 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 34, | ||
"index": 34 | ||
} | ||
} | ||
} | ||
] |
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 @@ | ||
const foo = () => ({...(void 0)}); |
Oops, something went wrong.