Skip to content

Commit

Permalink
Move function comments to their functions
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianheine authored and marijnh committed Oct 29, 2017
1 parent fd39391 commit c84f11a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/expression.js
Expand Up @@ -538,14 +538,14 @@ pp.parseTemplate = function({isTagged = false} = {}) {
return this.finishNode(node, "TemplateLiteral")
}

// Parse an object literal or binding pattern.

pp.isAsyncProp = function(prop) {
return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" &&
(this.type === tt.name || this.type === tt.num || this.type === tt.string || this.type === tt.bracketL || this.type.keyword) &&
!lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
}

// Parse an object literal or binding pattern.

pp.parseObj = function(isPattern, refDestructuringErrors) {
let node = this.startNode(), first = true, propHash = {}
node.properties = []
Expand Down Expand Up @@ -806,10 +806,6 @@ pp.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructur
return elts
}

// Parse the next token as an identifier. If `liberal` is true (used
// when parsing properties), it will also convert keywords into
// identifiers.

pp.checkUnreserved = function({start, end, name}) {
if (this.inGenerator && name === "yield")
this.raiseRecoverable(start, "Can not use 'yield' as identifier inside a generator")
Expand All @@ -824,6 +820,10 @@ pp.checkUnreserved = function({start, end, name}) {
this.raiseRecoverable(start, `The keyword '${name}' is reserved`)
}

// Parse the next token as an identifier. If `liberal` is true (used
// when parsing properties), it will also convert keywords into
// identifiers.

pp.parseIdent = function(liberal, isBinding) {
let node = this.startNode()
if (liberal && this.options.allowReserved == "never") liberal = false
Expand Down

0 comments on commit c84f11a

Please sign in to comment.