Skip to content

Method is not compiled properly by dart2js without the checked option #18717

Closed
@DartBot

Description

@DartBot

This issue was originally filed by ni...@blossom.io


If this is too little information please close it. Sadly I don't have reproducible example for you guys. It only happens in our main application.

Dart Editor version 1.3.6.release (STABLE)
Dart SDK version 1.3.6

In our case dart2js didn't compile a class method properly. It only didn't work for two classes, but worked for many other ones which are similar. All these classes are part of one Dart library.

As you can see in the code example the part where fullName and projectId is added to output is missing.

shell command


dart2js --out=dart/application/web/out/index.html_bootstrap.dart.js dart/application/web/out/index.html_bootstrap.dart

dart code


    core.Map toJson() {
      var output = new core.Map();
      if (fullName != null) {
        output["fullName"] = fullName;
      }
      if (projectId != null) {
        output["projectId"] = projectId;
      }
      return output;
    }

js code


    ApiMessagesGithubRepositoryConnectionCreateMessage: {
      "^": "Object;fullName<-,projectId-",
      toJson$0: [function() {
        var output = P.LinkedHashMap_LinkedHashMap(null, null, null, null, null);
        return output;
      }, "call$0", "get$toJson", 0, 0, 734, "toJson"],

When I compile it with the option --checked the output is fine and it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1A high priority bug; for example, a single project is unusable or has many test failuresweb-dart2js

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions