Skip to content

dart2js: --fast-startup emitter could better encode case for tear-off with no optional arguments #26754

Closed
@rakudrama

Description

@rakudrama

There is some confusion in the encoding of tear-off closures between null (no optional arguments) and a function returning [] (takes zero optional positional arguments).

Example:

  installTearOff(J.JSArray.prototype, "get$contains", false, true, 1, function() {
    return [];
  }, ["call$1"], ["contains$1"], 10);

should be encoded as:

  installTearOff(J.JSArray.prototype, "get$contains", false, true, 1, null, ["call$1"], ["contains$1"], 10);

This would save ~0.1% (0% after gzip) but would parse faster since there would be no diet parsed functions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions