clientside/amplesdk — Issue #122: Support for Array Comprehentions from Javascript 1.7
Author: h6w
Created: 2012-01-13 17:58:27+00:00
State: open

Features like Array comprehensions from Javascript 1.7 make are trivial to implement using a javascript preprocessor.

For example:
var evens = [i for each (i in range(0, 21)) if (i % 2 == 0)];
would become:

var evens = [];
for (var i=0; i <= 20; i++) {
if (i % 2 == 0)
evens.push(i);
}

Lots of this code exists in the form of XUL applications, because XUL runs in Firefox which supports JS 1.7. Small amounts of preprocessing would make porting XUL code much easier.