Status: New
Owner: ----

New issue 2568 by [email protected]: Array.prototype.map plucking out "length" causes function to stick
http://code.google.com/p/v8/issues/detail?id=2568

Hello! I ran into this investigating a regression in our application's use of underscore.js's pluck function. Here's a minimal repro test case:

// A short copy of _.pluck, which iterates through an array and returns another array, containing the values of some key. // e.g. pluck([{name: "Tom"}, {name: "Dick"}, {name: "Harry"}], "name") => ["Tom", "Dick", "Harry"]. var pluck = function(a, key) { return a.map(function(item){ return item[key]; }); };

// This line triggers the bug. Without this line, the pluck function works as expected.
// This line should (and does) return [2, 2].
pluck([[0,0],[0,0]], 'length');

// This line should return [1,2], but returns [2,2].
pluck([[1,2],[3,4]], '0');


Piping this into d8 on v8 head prints out

2,2
2,2

I'd expect it to print out:

2,2
1,3

I can repro in Chrome Version 26.0.1410.19 beta, but not in Chrome 25.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to