Fix #336 by correctly setting arrow-param (#337)

This commit is contained in:
Daniel Tschinder
2017-02-10 15:01:39 +01:00
committed by GitHub
parent 88d38a1abb
commit bc771bd0f9
4 changed files with 255 additions and 5 deletions

View File

@@ -1087,9 +1087,9 @@ export default function (instance) {
// parse an item inside a expression list eg. `(NODE, NODE)` where NODE represents
// the position where this function is called
instance.extend("parseExprListItem", function (inner) {
return function (allowEmpty, refShorthandDefaultPos) {
return function (...args) {
const container = this.startNode();
const node = inner.call(this, allowEmpty, refShorthandDefaultPos);
const node = inner.call(this, ...args);
if (this.match(tt.colon)) {
container._exprListItem = true;
container.expression = node;