allow keyword in Flow object declaration property names with type parameters (#146)

This commit is contained in:
Dan Harper
2016-10-14 20:15:00 +01:00
committed by Daniel Tschinder
parent f7c1af1c1f
commit 99fbcefa65
13 changed files with 2427 additions and 1 deletions

View File

@@ -336,6 +336,9 @@ pp.flowParseObjectTypeCallProperty = function (node, isStatic) {
};
pp.flowParseObjectType = function (allowStatic, allowExact) {
const oldInType = this.state.inType;
this.state.inType = true;
let nodeStart = this.startNode();
let node;
let propertyKey;
@@ -399,7 +402,11 @@ pp.flowParseObjectType = function (allowStatic, allowExact) {
this.expect(endDelim);
return this.finishNode(nodeStart, "ObjectTypeAnnotation");
const out = this.finishNode(nodeStart, "ObjectTypeAnnotation");
this.state.inType = oldInType;
return out;
};
pp.flowObjectTypeSemicolon = function () {