From d9deb02edc488e2c661e2f109cf892e51ce7b839 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 11 May 2015 23:44:22 +0100 Subject: [PATCH] register as inside a type when parsing type aliases to avoid ambiguous jsx parsing - fixes #1378 --- src/acorn/plugins/flow.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/acorn/plugins/flow.js b/src/acorn/plugins/flow.js index fad5277665..189395b6fa 100644 --- a/src/acorn/plugins/flow.js +++ b/src/acorn/plugins/flow.js @@ -153,10 +153,15 @@ pp.flow_parseTypeAlias = function (node) { node.typeParameters = null } + var oldInType = this.inType; + this.inType = true; + this.expect(tt.eq) node.right = this.flow_parseType() + this.inType = oldInType; + this.semicolon() return this.finishNode(node, "TypeAlias")