New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[js] js syntax error for `value.iterator--` #6637

Closed
RealyUniqueName opened this Issue Oct 4, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@RealyUniqueName
Member

RealyUniqueName commented Oct 4, 2017

class Test {   
    static function main() {        
        //this is required to enable HxOverrides.iter
        ([]:Iterable<Int>);
        
        test({iterator:0});        
    }
    	
    static public function test<T:{iterator:Int}>(v:T) {
        v.iterator--; //this is generated as `$iterator(v)--`
    }
}

Runtime error on chrome:

Uncaught ReferenceError: Invalid left-hand side expression in postfix operation

On Firefox syntax error occurs, so generated js is not even executed.
https://try.haxe.org/#E33F0

@RealyUniqueName RealyUniqueName self-assigned this Oct 4, 2017

RealyUniqueName added a commit to RealyUniqueName/haxe that referenced this issue Oct 4, 2017

RealyUniqueName added a commit that referenced this issue Oct 5, 2017

[js] fixed js syntax on `value.iterator--` (fixes #6637) (#6638)
* [js] fixed js syntax on `value.iterator--` (fixes #6637)

* changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment