Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Excessive variable and shallow copy for leading or middle rest parameter #5444

Open
123-Notus opened this issue Feb 4, 2023 · 0 comments

Comments

@123-Notus
Copy link

Input Code

f1 = (a..., b) ->

f2 = (c, d..., e) ->

Expected Behavior

var f1, f2,
  splice = [].splice;

f1 = function(...a) {
  var b;
  [b] = splice.call(a, -1);
};

f2 = function(c, ...d) {
  var e;
  [e] = splice.call(d, -1);
};

Current Behavior

var f1, f2,
  splice = [].splice;

f1 = function(...a) {
  var b, ref;
  ref = a, [...a] = ref, [b] = splice.call(a, -1);
};

f2 = function(c, ...d) {
  var e, ref;
  ref = d, [...d] = ref, [e] = splice.call(d, -1);
};

Environment

  • CoffeeScript version: 2.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant