Thanks to visit codestin.com
Credit goes to github.com

Skip to content

frogc generated wrong JS code #2739

Closed
Closed
@DartBot

Description

@DartBot

This issue was originally filed by @tomyeh


What steps will reproduce the problem?

  1. Compile the following code
    class C {
        Set<String> _classes;

    void run() {
        final StringBuffer out = new StringBuffer();
        if (_classes != null)
            for (final String cls in _classes) {
                out.add(' ').add(cls);
            }
    }
}
void main() {
    new C().run();
}

What is the expected output? What do you see instead?
frogc generated the wrong JS code:

  if (this._classes != null) var $$list = this._classes;
  for (var $$i = $$list.iterator(); $$i.hasNext(); ) {
    var cls = $$i.next();
    out.add(" ").add(cls);
  }

Obviously, a curly brace is missed to enclose var $$list...

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed-not-plannedClosed as we don't intend to take action on the reported issueweb-dart2js

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions