Skip to content

Commit

Permalink
Fix: reset isAsync flag for each property (fixes #298) (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea authored and nzakas committed Sep 29, 2016
1 parent acd7168 commit 7d3e2fc
Show file tree
Hide file tree
Showing 3 changed files with 472 additions and 2 deletions.
6 changes: 4 additions & 2 deletions espree.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ acorn.plugins.espree = function(instance) {
}

// grab the property name or "async"
this.parsePropertyName(prop/* , refDestructuringErrors */);
this.parsePropertyName(prop, refShorthandDefaultPos);
if (this.options.ecmaVersion >= 8 &&
!isPattern &&
!isGenerator &&
Expand All @@ -382,8 +382,10 @@ acorn.plugins.espree = function(instance) {
this.type !== tt.colon &&
!this.canInsertSemicolon()
) {
this.parsePropertyName(prop/* , refDestructuringErrors */);
this.parsePropertyName(prop, refShorthandDefaultPos);
isAsync = true;
} else {
isAsync = false;
}

this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refShorthandDefaultPos);
Expand Down
Loading

0 comments on commit 7d3e2fc

Please sign in to comment.