in partnership with mediatemple

Ticket #991 (closed defect: invalid)

Opened 3 weeks ago

Last modified 3 weeks ago

mootools breaks array comprehensions

Reported by: murat Owned by:
Type: defect Priority: major
Milestone: Mootools version 1.2 Component: Core
Keywords: Cc:

Description

mootools appears to extend Array in a manner that spoils the ability to use array comprehensions (see http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7#Array_comprehensions)

Here's an example:

var numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
var someThings = [n for each (n in numbers)]; 

After executing the above code, someThings should be an array just like numbers, but if you examine it in a debugger or do something like alert(someThings), you'll see that someThings includes extra mootools baggage. This makes array comprehensions pretty much unusable.

Change History

Changed 3 weeks ago by 131

use numbers.each instead, if not supported by your browser, mootools catch and emulate it.

Changed 3 weeks ago by kamicane

  • status changed from new to closed
  • resolution set to invalid
Note: See TracTickets for help on using tickets.