Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Wrong arguments passing order. #114

Closed
danez opened this issue Sep 8, 2016 · 0 comments
Closed

Wrong arguments passing order. #114

danez opened this issue Sep 8, 2016 · 0 comments

Comments

@danez
Copy link
Member

danez commented Sep 8, 2016

Reported by @virtyaluk

I'm exploring source code of babylon parser and saw next code under lval.js:

// Parses spread element.

pp.parseSpread = function (refShorthandDefaultPos) {
  let node = this.startNode();
  this.next();
  node.argument = this.parseMaybeAssign(refShorthandDefaultPos);
  return this.finishNode(node, "SpreadElement");
};

Pay attention to the line:

node.argument = this.parseMaybeAssign(refShorthandDefaultPos);

And have a look at parseMaybessign signature:

function (noIn, refShorthandDefaultPos, afterLeftParse)

Seems like argument passed in wrong order.
I believe, there's need to pass some bool argument first and only then pass refShorthandDefaultPos.
Am I wrong?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant