GeezerVison is showing github.com — Computed props are not properly handled · Issue #2507 · nodejs/node
Computed props are not properly handled #2507DescriptionRepost of microsoft/TypeScript#4419
Seems like this problem is related to v8. Following code (using [email protected])
var prop = 'age'
var val = 42
console.log([{ name: "ivan", [prop]: val }])
console.log({ name: "ivan", [prop]: val })
produces output
[ { name: 'ivan' } ]
{ name: 'ivan', age: 42 }
ActivityFishrock123 commented on Aug 23, 2015 Weird that the bottom works but the top doesn't. @ofrobots? mscdex commented on Aug 23, 2015 FWIW same issue exists in next+1/v8 4.5 changed the title [-]Computed pops are not properly handled[/-] [+]Computed props are not properly handled[/+] on Aug 23, 2015ofrobots commented on Aug 23, 2015 lazdmx commented on Aug 23, 2015 Fishrock123 commented on Aug 23, 2015 Closing, nothing io.js itself can do. :) lazdmx commented on Aug 24, 2015 rvagg commented on Aug 24, 2015 We're going in to LTS with this version of V8, I hope this isn't going to bite us in a similar way to Array.values() in 0.12, perhaps this should be part of our "Known issues"? Fishrock123 commented on Aug 24, 2015 Yeah perhaps we should document it. It's not a thing that perviously existed though (afaik) so I think we're good there. mgol commented on Aug 25, 2015 This seems worrying, especially that it's available by default, not behind a flag. Comments in the V8 issue suggest the fix for that will be a one-liner. I somehow missed that Node 4.0.0 will use v8 4.4, not 4.5 (i.e. the same as io.js 3) but since v8 4.4 will soon lose upstream support perhaps patching this on the Node.js side wouldn't introduce big issues? rvagg commented on Aug 26, 2015 I'd not be opposed to floating a patch on v8 for this when they drop support for 4.4 upstream because we're going to have to be supporting this version for some time and will be adding our own patches to it anyway. I don't see this as being a huge problem, at least initially, but perhaps as folks start using computed properties for newer versions of node and v4 LTS starts to get a bit old we could end up in hot water. Fishrock123 commented on Aug 26, 2015 I'm fine with just leaving a note about it I think. rvagg commented on Sep 15, 2015 brendanashworth commented on Sep 17, 2015 The fix landed in 704dcce and was released in 4.1.0, closing.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|