Allow "async" as identifier for object literal property shorthand (#187)

This commit is contained in:
Andrew Levine
2016-10-17 09:33:18 -05:00
committed by Henry Zhu
parent 9b6e243736
commit 01e984fd0f
3 changed files with 212 additions and 1 deletions

View File

@@ -762,7 +762,7 @@ pp.parseObj = function (isPattern, refShorthandDefaultPos) {
if (isGenerator) this.unexpected();
let asyncId = this.parseIdentifier();
if (this.match(tt.colon) || this.match(tt.parenL) || this.match(tt.braceR) || this.match(tt.eq)) {
if (this.match(tt.colon) || this.match(tt.parenL) || this.match(tt.braceR) || this.match(tt.eq) || this.match(tt.comma)) {
prop.key = asyncId;
} else {
isAsync = true;