Skip to content

Better handling of splat func arguments #857

Description

@summivox

According to Petka, calling slice$ on arguments kills v8 optimization. He suggested to do a naive indexed for loop on arguments instead.

Currently:

f = (a, ...b, c) ->

compiles to:

f = function(a){
  var i$, b, c;
  b = 1 < (i$ = arguments.length - 1) ? slice$.call(arguments, 1, i$) : (i$ = 1, []), c = arguments[i$];
};

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions