Revert "remove do expressions"

This reverts commit 420492388b06ff295a638adbea0f34c726056607.
This commit is contained in:
Sebastian McKenzie 2015-07-13 20:45:49 +01:00
parent 1e77212efa
commit da9493e1fa

View File

@ -281,6 +281,20 @@ pp.parseExprAtom = function(refShorthandDefaultPos) {
case tt._yield:
if (this.inGenerator) this.unexpected()
case tt._do:
if (this.options.features["es7.doExpressions"]) {
let node = this.startNode()
this.next()
var oldInFunction = this.inFunction
var oldLabels = this.labels
this.labels = []
this.inFunction = false
node.body = this.parseBlock()
this.inFunction = oldInFunction
this.labels = oldLabels
return this.finishNode(node, "DoExpression")
}
case tt.name:
let start = this.markPosition()
node = this.startNode()