allow keyword in Flow object declaration property names with type parameters (#146)
This commit is contained in:
committed by
Daniel Tschinder
parent
f7c1af1c1f
commit
99fbcefa65
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user