Skip to content

Inconsistent slice/splice caching for splats and ranges #1332

@jed

Description

@jed

Seeing that

(args...) ->
  args[1..2] = null

currently yields

var __slice = Array.prototype.slice;
(function() {
  var args;
  args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
  return ([].splice.apply(args, [1, 2].concat(null)), null);
});

is there any reason that slice is cached from Array.prototype, but not splice is used from a new array instance?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions