jsx/JSX — pull request #56 by mzp (2012-07-01 06:51:30+00:00)
Title: fix array-length optimizer bug

Following code crush compiler(a6a679de9dfb34e179a15b534119889ad49841a1) with array-length optimizer.

class _Test {
function main() : void {
var xs = [] : number[];
for(var i = 0; i < xs.length*1; i += 1) {}
}
}

---

$ jsx --optimize array-length foo.jsx
optimizer 'undefined' died unexpectedly, dumping the logs
starting optimizer: array-length
[array-length] starting optimization of Math.abs(:number)
[array-length] finished optimization of Math.abs(:number)
[array-length] starting optimization of Math.max(:number, :number)
[array-length] finished optimization of Math.max(:number, :number)
[array-length] starting optimization of Math.min(:number, :number)
[array-length] finished optimization of Math.min(:number, :number)
[array-length] starting optimization of Array.#forEach(:function ( : Nullable.) : void)
[array-length] finished optimization of Array.#forEach(:function ( : Nullable.) : void)
[array-length] starting optimization of _Test#main()

/Users/mzp/workspaces/JSX/src/optimizer.js:161
throw e;
^
TypeError: Object #