From 6128fd968701cec78acf6b12215db4e64a3ed90d Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sun, 22 Mar 2015 04:06:15 +1100 Subject: [PATCH] add do expressions --- src/expression.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/expression.js b/src/expression.js index b40024559f..0702837dcb 100755 --- a/src/expression.js +++ b/src/expression.js @@ -245,6 +245,14 @@ pp.parseExprAtom = function(refShorthandDefaultPos) { case tt._yield: if (this.inGenerator) unexpected() + case tt._do: + if (this.options.features["es7.doExpressions"]) { + let node = this.startNode() + this.next() + node.body = this.parseBlock() + return this.finishNode(node, "DoExpression") + } + case tt.name: let start = this.markPosition() node = this.startNode()