jsx / JSX

JSX - a faster, safer, easier JavaScript
http://jsx.github.io/
MIT License
1.46k stars 102 forks source link

Do not expand FusedAssignmentExpression by _InlineOptimizeCommand #329

Closed tuchida closed 10 years ago

tuchida commented 10 years ago

This code is compile error same as #328.

import "console.jsx";

class _Main {

    static function fn(a : number) : void {
        a += 2;
        console.log(a);
    }

    static function main(args : string[]) : void {
        _Main.fn(1);
    }
}

Do not expand FusedAssignmentExpression in the same way as AssignmentExpression and IncrementExpression.

kazuho commented 10 years ago

Thank you for reporting the issue. Took your test and fixed the problem in a slightly different way.

It is really a pitfall that FusedAssignmentExpression is not a subclass of AssignmentExpression. It might be better to look into other parts of the code if similar problem exists.

tuchida commented 10 years ago

Thanks!

It is really a pitfall that FusedAssignmentExpression is not a subclass of AssignmentExpression.

That's for sure. Both of AST is Assignment in Rhino and esprima.