Issue 6098 in v8: SyntaxError: Invalid destructuring assignment target on valid code

163 views
Skip to first unread message

brett.ju… via monorail

unread,
Mar 14, 2017, 5:33:40 PM3/14/17
to v8-re...@googlegroups.com
Status: Untriaged
Owner: ----

New issue 6098 by brett.ju...@avant.com: SyntaxError: Invalid destructuring assignment target on valid code
https://bugs.chromium.org/p/v8/issues/detail?id=6098

Version: 5.7.492.63
OS: macOS El Capitan
Architecture: x64

What steps will reproduce the problem?
1. Run script
2. Get Syntax Error

What is the expected output?
Not to get a Syntax Error

What do you see instead?
Syntax Error

(Minimal code reproduction)
A function like this:

```
const fn = (c) => {
let d = [1, 2],
e = null,
f = null;
0 < c.getIn(['a']) ? [e, f] = d : [e, f] = d, console.log(e, f);
};
```

has a syntax error, however


```
const fn = (c) => {
let d = [1, 2],
e = null,
f = null;
0 < c.getIn([]) ? [e, f] = d : [e, f] = d, console.log(e, f);
};
```

is fine.

Babel, safari, and firefox do not give a syntax error, but Chrome & Node do.

there's some more info here where I initially reported it: https://github.com/babel/babili/issues/476

Let me know if any more information is needed

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

ad… via monorail

unread,
Mar 14, 2017, 8:08:42 PM3/14/17
to v8-re...@googlegroups.com
Updates:
Components: Language
Labels: SpecViolation-ReadyToFix HW-All OS-All
Owner: ad...@chromium.org
Status: Assigned

Comment #1 on issue 6098 by ad...@chromium.org: SyntaxError: Invalid destructuring assignment target on valid code
https://bugs.chromium.org/p/v8/issues/detail?id=6098#c1

Thank you for the bug report, and for minimizing it so fully. Definitely a V8 parsing bug, will dig into it.
Reply all
Reply to author
Forward
0 new messages