You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Destructuring of arrow function arguments via computed property throws in v6.x #10347
uname -a: Darwin Olegs-MacBook-Pro.local 16.4.0 Darwin Kernel Version 16.4.0: Wed Dec 7 12:06:26 PST 2016; root:xnu-3789.41.1~5/RELEASE_X86_64 x86_64
// Throws in Nodejs 6.x with -> ReferenceError: y is not definedvary='a';varg20=({[y]: x})=>{vary='b';returnx;};require('assert').equal(1,g20({a: 1,b: 2}));
changed the title [-]Destructuring of function arguments via computed property throws[/-][+]Destructuring of arrow function arguments via computed property throws[/+]on Dec 19, 2016
changed the title [-]Destructuring of arrow function arguments via computed property throws[/-][+]Destructuring of arrow function arguments via computed property throws in v6.9.2[/+]on Dec 19, 2016
changed the title [-]Destructuring of arrow function arguments via computed property throws in v6.9.2[/-][+]Destructuring of arrow function arguments via computed property throws in v6.x[/+]on Dec 20, 2016
@hashseed I think this is a fix we want to backport. Do I read it correctly that it was broken because of some interaction with Node (because V8 has a test for it and it's not a regression test)?
Activity
vsemozhetbyt commentedon Dec 19, 2016
According to node.green it should work in 6.9.0–6.9.2. This example from "computed properties" tooltip there works fine in the 6.9.2
oaleynik commentedon Dec 19, 2016
@vsemozhetbyt example from node.green indeed works. But the same example, slightly changed, throws:
UPDATE: What is interesting - if replace arrow function with the regular function - it works.
vsemozhetbyt commentedon Dec 19, 2016
So this is corrected formulation: destructuring of arrow function arguments via computed property throws in the Node.js 6.9.2:
[-]Destructuring of function arguments via computed property throws[/-][+]Destructuring of arrow function arguments via computed property throws[/+][-]Destructuring of arrow function arguments via computed property throws[/-][+]Destructuring of arrow function arguments via computed property throws in v6.9.2[/+]oaleynik commentedon Dec 19, 2016
Thanks @vsemozhetbyt, I've updated the issue title and description.
vsemozhetbyt commentedon Dec 20, 2016
It seems the bug is actual only for destructuring. Other evaluations in the parameters scope are OK.
oaleynik commentedon Dec 20, 2016
I see the test case for this in V8 on 6.x branch: https://github.com/nodejs/node/blob/v6.x/deps/v8/test/mjsunit/es6/destructuring.js#L893
Should not it fail?
vsemozhetbyt commentedon Dec 20, 2016
Well, this throws:
I don't know why it does not fail there(
vsemozhetbyt commentedon Dec 20, 2016
Maybe these tests are not actually tested during Node.js build (unlike Node tests)?
MylesBorins commentedon Dec 20, 2016
[-]Destructuring of arrow function arguments via computed property throws in v6.9.2[/-][+]Destructuring of arrow function arguments via computed property throws in v6.x[/+]hashseed commentedon Dec 21, 2016
This seems to work correctly on the newest V8 (version 5.7).
@fhinkel is there any merit in bisecting what the fix was?
fhinkel commentedon Dec 21, 2016
@hashseed I think this is a fix we want to backport. Do I read it correctly that it was broken because of some interaction with Node (because V8 has a test for it and it's not a regression test)?
hashseed commentedon Dec 21, 2016
@fhinkel I'm under the impression that it's just broken due to V8, and should be reproducible on d8 at an older version. I haven't tested though.
targos commentedon Dec 21, 2016
Just compared node with d8 (V8 5.1.281.89) both built from
v6.x-stagingand the following test:Test fails with both, only when the code is wrapped in an IIFE (simulating our module wrapper).
targos commentedon Dec 21, 2016
The bug is already fixed in
5.2-lkgr. I'm trying to do a bisect but I get the following error at the end of the build:hashseed commentedon Dec 21, 2016
Looks like a gclient sync issue.
targos commentedon Dec 21, 2016
Still happens after removing binutils and syncing again.
Fixed with
ln -fs /usr/bin/ld.gold ./third_party/binutils/Linux_x64/Release/bin/ld.golddeps: backport f795a79 from upstream V8
targos commentedon Dec 21, 2016
#10386
deps: backport f795a79 from upstream V8
fhinkel commentedon Jan 20, 2017
Looks like @targos fixed it.
targos commentedon Jan 20, 2017
Thanks. I forgot that we can only close issues by pushing on master!