[flow] Explicit inexact objects with ... (#8884)

This commit is contained in:
Jordan Brown 2018-10-29 16:09:17 -04:00 committed by Brian Ng
parent d942d47e10
commit e4929e11f6
77 changed files with 1181 additions and 86 deletions

View File

@ -463,7 +463,13 @@ export default (superClass: Class<Parser>): Class<Parser> =>
} while (this.eat(tt.comma)); } while (this.eat(tt.comma));
} }
node.body = this.flowParseObjectType(isClass, false, false, isClass); node.body = this.flowParseObjectType({
allowStatic: isClass,
allowExact: false,
allowSpread: false,
allowProto: isClass,
allowInexact: false,
});
} }
flowParseInterfaceExtends(): N.FlowInterfaceExtends { flowParseInterfaceExtends(): N.FlowInterfaceExtends {
@ -656,7 +662,13 @@ export default (superClass: Class<Parser>): Class<Parser> =>
} while (this.eat(tt.comma)); } while (this.eat(tt.comma));
} }
node.body = this.flowParseObjectType(false, false, false, false); node.body = this.flowParseObjectType({
allowStatic: false,
allowExact: false,
allowSpread: false,
allowProto: false,
allowInexact: false,
});
return this.finishNode(node, "InterfaceTypeAnnotation"); return this.finishNode(node, "InterfaceTypeAnnotation");
} }
@ -754,12 +766,19 @@ export default (superClass: Class<Parser>): Class<Parser> =>
return this.finishNode(node, "ObjectTypeCallProperty"); return this.finishNode(node, "ObjectTypeCallProperty");
} }
flowParseObjectType( flowParseObjectType({
allowStatic,
allowExact,
allowSpread,
allowProto,
allowInexact,
}: {
allowStatic: boolean, allowStatic: boolean,
allowExact: boolean, allowExact: boolean,
allowSpread: boolean, allowSpread: boolean,
allowProto: boolean, allowProto: boolean,
): N.FlowObjectTypeAnnotation { allowInexact: boolean,
}): N.FlowObjectTypeAnnotation {
const oldInType = this.state.inType; const oldInType = this.state.inType;
this.state.inType = true; this.state.inType = true;
@ -772,6 +791,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
let endDelim; let endDelim;
let exact; let exact;
let inexact = false;
if (allowExact && this.match(tt.braceBarL)) { if (allowExact && this.match(tt.braceBarL)) {
this.expect(tt.braceBarL); this.expect(tt.braceBarL);
endDelim = tt.braceBarR; endDelim = tt.braceBarR;
@ -852,16 +872,21 @@ export default (superClass: Class<Parser>): Class<Parser> =>
} }
} }
nodeStart.properties.push( const propOrInexact = this.flowParseObjectTypeProperty(
this.flowParseObjectTypeProperty( node,
node, isStatic,
isStatic, protoStart,
protoStart, variance,
variance, kind,
kind, allowSpread,
allowSpread, allowInexact,
),
); );
if (propOrInexact === null) {
inexact = true;
} else {
nodeStart.properties.push(propOrInexact);
}
} }
this.flowObjectTypeSemicolon(); this.flowObjectTypeSemicolon();
@ -869,6 +894,15 @@ export default (superClass: Class<Parser>): Class<Parser> =>
this.expect(endDelim); this.expect(endDelim);
/* The inexact flag should only be added on ObjectTypeAnnotations that
* are not the body of an interface, declare interface, or declare class.
* Since spreads are only allowed in objec types, checking that is
* sufficient here.
*/
if (allowSpread) {
nodeStart.inexact = inexact;
}
const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); const out = this.finishNode(nodeStart, "ObjectTypeAnnotation");
this.state.inType = oldInType; this.state.inType = oldInType;
@ -883,7 +917,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
variance: ?N.FlowVariance, variance: ?N.FlowVariance,
kind: string, kind: string,
allowSpread: boolean, allowSpread: boolean,
): N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty { allowInexact: boolean,
): (N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty) | null {
if (this.match(tt.ellipsis)) { if (this.match(tt.ellipsis)) {
if (!allowSpread) { if (!allowSpread) {
this.unexpected( this.unexpected(
@ -901,8 +936,30 @@ export default (superClass: Class<Parser>): Class<Parser> =>
); );
} }
this.expect(tt.ellipsis); this.expect(tt.ellipsis);
node.argument = this.flowParseType(); const isInexactToken = this.eat(tt.comma) || this.eat(tt.semi);
if (this.match(tt.braceR)) {
if (allowInexact) return null;
this.unexpected(
null,
"Explicit inexact syntax is only allowed inside inexact objects",
);
}
if (this.match(tt.braceBarR)) {
this.unexpected(
null,
"Explicit inexact syntax cannot appear inside an explicit exact object type",
);
}
if (isInexactToken) {
this.unexpected(
null,
"Explicit inexact syntax must appear at the end of an inexact object",
);
}
node.argument = this.flowParseType();
return this.finishNode(node, "ObjectTypeSpreadProperty"); return this.finishNode(node, "ObjectTypeSpreadProperty");
} else { } else {
node.key = this.flowParseObjectPropertyKey(); node.key = this.flowParseObjectPropertyKey();
@ -1146,10 +1203,22 @@ export default (superClass: Class<Parser>): Class<Parser> =>
); );
case tt.braceL: case tt.braceL:
return this.flowParseObjectType(false, false, true, false); return this.flowParseObjectType({
allowStatic: false,
allowExact: false,
allowSpread: true,
allowProto: false,
allowInexact: true,
});
case tt.braceBarL: case tt.braceBarL:
return this.flowParseObjectType(false, true, true, false); return this.flowParseObjectType({
allowStatic: false,
allowExact: true,
allowSpread: true,
allowProto: false,
allowInexact: false,
});
case tt.bracketL: case tt.bracketL:
return this.flowParseTupleType(); return this.flowParseTupleType();

View File

@ -156,7 +156,8 @@
"properties": [], "properties": [],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -156,7 +156,8 @@
"properties": [], "properties": [],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -308,7 +308,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -256,7 +256,8 @@
"properties": [], "properties": [],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -239,7 +239,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -239,7 +239,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -146,7 +146,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
} }

View File

@ -192,7 +192,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
} }

View File

@ -243,7 +243,8 @@
} }
], ],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -422,7 +422,8 @@
"properties": [], "properties": [],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -0,0 +1,4 @@
//@flow
declare class A {
...;
}

View File

@ -0,0 +1,5 @@
{
"sourceType": "module",
"plugins": ["jsx", "flow"],
"throws": "Spread operator cannot appear in class or interface definitions (3:2)"
}

View File

@ -0,0 +1,5 @@
//@flow
declare class B {
foo: number;
...;
}

View File

@ -0,0 +1,5 @@
{
"sourceType": "module",
"plugins": ["jsx", "flow"],
"throws": "Spread operator cannot appear in class or interface definitions (4:2)"
}

View File

@ -0,0 +1,5 @@
//@flow
declare class C {
...;
foo: number;
}

View File

@ -0,0 +1,5 @@
{
"sourceType": "module",
"plugins": ["jsx", "flow"],
"throws": "Spread operator cannot appear in class or interface definitions (3:2)"
}

View File

@ -0,0 +1,6 @@
//@flow
declare class D {
foo: number;
...;
bar: number;
}

View File

@ -0,0 +1,5 @@
{
"sourceType": "module",
"plugins": ["jsx", "flow"],
"throws": "Spread operator cannot appear in class or interface definitions (4:2)"
}

View File

@ -0,0 +1,5 @@
//@flow
interface F {
foo: number;
...;
}

View File

@ -0,0 +1,5 @@
{
"sourceType": "module",
"plugins": ["jsx", "flow"],
"throws": "Spread operator cannot appear in class or interface definitions (4:2)"
}

View File

@ -0,0 +1,5 @@
//@flow
interface G {
...;
foo: number;
}

View File

@ -0,0 +1,5 @@
{
"sourceType": "module",
"plugins": ["jsx", "flow"],
"throws": "Spread operator cannot appear in class or interface definitions (3:2)"
}

View File

@ -0,0 +1,6 @@
//@flow
interface H {
foo: number;
...;
bar: number;
}

View File

@ -0,0 +1,5 @@
{
"sourceType": "module",
"plugins": ["jsx", "flow"],
"throws": "Spread operator cannot appear in class or interface definitions (4:2)"
}

View File

@ -0,0 +1,2 @@
//@flow
type T = {| foo: number, ... |}

View File

@ -0,0 +1,5 @@
{
"sourceType": "module",
"plugins": ["jsx", "flow"],
"throws": "Explicit inexact syntax cannot appear inside an explicit exact object type (2:29)"
}

View File

@ -0,0 +1,2 @@
//@flow
type T = {..., foo: number};

View File

@ -0,0 +1,5 @@
{
"sourceType": "module",
"plugins": ["jsx", "flow"],
"throws": "Explicit inexact syntax must appear at the end of an inexact object (2:15)"
}

View File

@ -0,0 +1,4 @@
//@flow
type T = {...};
type U = {x: number, ...};
type V = {x: number, ...V, ...U};

View File

@ -0,0 +1,437 @@
{
"type": "File",
"start": 0,
"end": 84,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 4,
"column": 33
}
},
"program": {
"type": "Program",
"start": 0,
"end": 84,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 4,
"column": 33
}
},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "TypeAlias",
"start": 8,
"end": 23,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 15
}
},
"id": {
"type": "Identifier",
"start": 13,
"end": 14,
"loc": {
"start": {
"line": 2,
"column": 5
},
"end": {
"line": 2,
"column": 6
},
"identifierName": "T"
},
"name": "T"
},
"typeParameters": null,
"right": {
"type": "ObjectTypeAnnotation",
"start": 17,
"end": 22,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 14
}
},
"callProperties": [],
"properties": [],
"indexers": [],
"internalSlots": [],
"exact": false,
"inexact": true
},
"leadingComments": [
{
"type": "CommentLine",
"value": "@flow",
"start": 0,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 7
}
}
}
]
},
{
"type": "TypeAlias",
"start": 24,
"end": 50,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 26
}
},
"id": {
"type": "Identifier",
"start": 29,
"end": 30,
"loc": {
"start": {
"line": 3,
"column": 5
},
"end": {
"line": 3,
"column": 6
},
"identifierName": "U"
},
"name": "U"
},
"typeParameters": null,
"right": {
"type": "ObjectTypeAnnotation",
"start": 33,
"end": 49,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 25
}
},
"callProperties": [],
"properties": [
{
"type": "ObjectTypeProperty",
"start": 34,
"end": 43,
"loc": {
"start": {
"line": 3,
"column": 10
},
"end": {
"line": 3,
"column": 19
}
},
"key": {
"type": "Identifier",
"start": 34,
"end": 35,
"loc": {
"start": {
"line": 3,
"column": 10
},
"end": {
"line": 3,
"column": 11
},
"identifierName": "x"
},
"name": "x"
},
"static": false,
"proto": false,
"kind": "init",
"method": false,
"value": {
"type": "NumberTypeAnnotation",
"start": 37,
"end": 43,
"loc": {
"start": {
"line": 3,
"column": 13
},
"end": {
"line": 3,
"column": 19
}
}
},
"variance": null,
"optional": false
}
],
"indexers": [],
"internalSlots": [],
"exact": false,
"inexact": true
}
},
{
"type": "TypeAlias",
"start": 51,
"end": 84,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 33
}
},
"id": {
"type": "Identifier",
"start": 56,
"end": 57,
"loc": {
"start": {
"line": 4,
"column": 5
},
"end": {
"line": 4,
"column": 6
},
"identifierName": "V"
},
"name": "V"
},
"typeParameters": null,
"right": {
"type": "ObjectTypeAnnotation",
"start": 60,
"end": 83,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 32
}
},
"callProperties": [],
"properties": [
{
"type": "ObjectTypeProperty",
"start": 61,
"end": 70,
"loc": {
"start": {
"line": 4,
"column": 10
},
"end": {
"line": 4,
"column": 19
}
},
"key": {
"type": "Identifier",
"start": 61,
"end": 62,
"loc": {
"start": {
"line": 4,
"column": 10
},
"end": {
"line": 4,
"column": 11
},
"identifierName": "x"
},
"name": "x"
},
"static": false,
"proto": false,
"kind": "init",
"method": false,
"value": {
"type": "NumberTypeAnnotation",
"start": 64,
"end": 70,
"loc": {
"start": {
"line": 4,
"column": 13
},
"end": {
"line": 4,
"column": 19
}
}
},
"variance": null,
"optional": false
},
{
"type": "ObjectTypeSpreadProperty",
"start": 72,
"end": 76,
"loc": {
"start": {
"line": 4,
"column": 21
},
"end": {
"line": 4,
"column": 25
}
},
"argument": {
"type": "GenericTypeAnnotation",
"start": 75,
"end": 76,
"loc": {
"start": {
"line": 4,
"column": 24
},
"end": {
"line": 4,
"column": 25
}
},
"typeParameters": null,
"id": {
"type": "Identifier",
"start": 75,
"end": 76,
"loc": {
"start": {
"line": 4,
"column": 24
},
"end": {
"line": 4,
"column": 25
},
"identifierName": "V"
},
"name": "V"
}
}
},
{
"type": "ObjectTypeSpreadProperty",
"start": 78,
"end": 82,
"loc": {
"start": {
"line": 4,
"column": 27
},
"end": {
"line": 4,
"column": 31
}
},
"argument": {
"type": "GenericTypeAnnotation",
"start": 81,
"end": 82,
"loc": {
"start": {
"line": 4,
"column": 30
},
"end": {
"line": 4,
"column": 31
}
},
"typeParameters": null,
"id": {
"type": "Identifier",
"start": 81,
"end": 82,
"loc": {
"start": {
"line": 4,
"column": 30
},
"end": {
"line": 4,
"column": 31
},
"identifierName": "U"
},
"name": "U"
}
}
}
],
"indexers": [],
"internalSlots": [],
"exact": false,
"inexact": false
}
}
],
"directives": []
},
"comments": [
{
"type": "CommentLine",
"value": "@flow",
"start": 0,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 7
}
}
}
]
}

View File

@ -0,0 +1,2 @@
//@flow
type T = {x: number, ..., y: number};

View File

@ -0,0 +1,5 @@
{
"sourceType": "module",
"plugins": ["jsx", "flow"],
"throws": "Explicit inexact syntax must appear at the end of an inexact object (2:26)"
}

View File

@ -0,0 +1,2 @@
//@flow
type U = {x: number, ..., ...};

View File

@ -0,0 +1,5 @@
{
"sourceType": "module",
"plugins": ["jsx", "flow"],
"throws": "Explicit inexact syntax must appear at the end of an inexact object (2:26)"
}

View File

@ -0,0 +1,2 @@
//@flow
type V = {x: number, ..., ...X};

View File

@ -0,0 +1,5 @@
{
"sourceType": "module",
"plugins": ["jsx", "flow"],
"throws": "Explicit inexact syntax must appear at the end of an inexact object (2:26)"
}

View File

@ -0,0 +1,11 @@
//@flow
type T = { ..., };
type U = { ...; };
type V = {
x: number,
...,
};
type W = {
x: number;
...;
};

View File

@ -0,0 +1,395 @@
{
"type": "File",
"start": 0,
"end": 113,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 11,
"column": 2
}
},
"program": {
"type": "Program",
"start": 0,
"end": 113,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 11,
"column": 2
}
},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "TypeAlias",
"start": 8,
"end": 26,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 18
}
},
"id": {
"type": "Identifier",
"start": 13,
"end": 14,
"loc": {
"start": {
"line": 2,
"column": 5
},
"end": {
"line": 2,
"column": 6
},
"identifierName": "T"
},
"name": "T"
},
"typeParameters": null,
"right": {
"type": "ObjectTypeAnnotation",
"start": 17,
"end": 25,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 17
}
},
"callProperties": [],
"properties": [],
"indexers": [],
"internalSlots": [],
"exact": false,
"inexact": true
},
"leadingComments": [
{
"type": "CommentLine",
"value": "@flow",
"start": 0,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 7
}
}
}
]
},
{
"type": "TypeAlias",
"start": 27,
"end": 45,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 18
}
},
"id": {
"type": "Identifier",
"start": 32,
"end": 33,
"loc": {
"start": {
"line": 3,
"column": 5
},
"end": {
"line": 3,
"column": 6
},
"identifierName": "U"
},
"name": "U"
},
"typeParameters": null,
"right": {
"type": "ObjectTypeAnnotation",
"start": 36,
"end": 44,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 17
}
},
"callProperties": [],
"properties": [],
"indexers": [],
"internalSlots": [],
"exact": false,
"inexact": true
}
},
{
"type": "TypeAlias",
"start": 46,
"end": 79,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 7,
"column": 2
}
},
"id": {
"type": "Identifier",
"start": 51,
"end": 52,
"loc": {
"start": {
"line": 4,
"column": 5
},
"end": {
"line": 4,
"column": 6
},
"identifierName": "V"
},
"name": "V"
},
"typeParameters": null,
"right": {
"type": "ObjectTypeAnnotation",
"start": 55,
"end": 78,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 7,
"column": 1
}
},
"callProperties": [],
"properties": [
{
"type": "ObjectTypeProperty",
"start": 59,
"end": 68,
"loc": {
"start": {
"line": 5,
"column": 2
},
"end": {
"line": 5,
"column": 11
}
},
"key": {
"type": "Identifier",
"start": 59,
"end": 60,
"loc": {
"start": {
"line": 5,
"column": 2
},
"end": {
"line": 5,
"column": 3
},
"identifierName": "x"
},
"name": "x"
},
"static": false,
"proto": false,
"kind": "init",
"method": false,
"value": {
"type": "NumberTypeAnnotation",
"start": 62,
"end": 68,
"loc": {
"start": {
"line": 5,
"column": 5
},
"end": {
"line": 5,
"column": 11
}
}
},
"variance": null,
"optional": false
}
],
"indexers": [],
"internalSlots": [],
"exact": false,
"inexact": true
}
},
{
"type": "TypeAlias",
"start": 80,
"end": 113,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 11,
"column": 2
}
},
"id": {
"type": "Identifier",
"start": 85,
"end": 86,
"loc": {
"start": {
"line": 8,
"column": 5
},
"end": {
"line": 8,
"column": 6
},
"identifierName": "W"
},
"name": "W"
},
"typeParameters": null,
"right": {
"type": "ObjectTypeAnnotation",
"start": 89,
"end": 112,
"loc": {
"start": {
"line": 8,
"column": 9
},
"end": {
"line": 11,
"column": 1
}
},
"callProperties": [],
"properties": [
{
"type": "ObjectTypeProperty",
"start": 93,
"end": 102,
"loc": {
"start": {
"line": 9,
"column": 2
},
"end": {
"line": 9,
"column": 11
}
},
"key": {
"type": "Identifier",
"start": 93,
"end": 94,
"loc": {
"start": {
"line": 9,
"column": 2
},
"end": {
"line": 9,
"column": 3
},
"identifierName": "x"
},
"name": "x"
},
"static": false,
"proto": false,
"kind": "init",
"method": false,
"value": {
"type": "NumberTypeAnnotation",
"start": 96,
"end": 102,
"loc": {
"start": {
"line": 9,
"column": 5
},
"end": {
"line": 9,
"column": 11
}
}
},
"variance": null,
"optional": false
}
],
"indexers": [],
"internalSlots": [],
"exact": false,
"inexact": true
}
}
],
"directives": []
},
"comments": [
{
"type": "CommentLine",
"value": "@flow",
"start": 0,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 7
}
}
}
]
}

View File

@ -166,7 +166,8 @@
} }
} }
], ],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -148,7 +148,8 @@
} }
} }
], ],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -147,7 +147,8 @@
} }
} }
], ],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -168,7 +168,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
}, },
"body": { "body": {

View File

@ -168,7 +168,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
}, },
"body": { "body": {

View File

@ -233,7 +233,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -153,7 +153,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
}, },
{ {
"type": "ObjectTypeAnnotation", "type": "ObjectTypeAnnotation",
@ -232,7 +233,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
] ]
} }
@ -626,7 +628,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
}, },
{ {
"type": "ObjectTypeAnnotation", "type": "ObjectTypeAnnotation",
@ -705,7 +708,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
] ]
}, },
@ -715,7 +719,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
}, },
{ {
@ -893,7 +898,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
}, },
{ {
"type": "ObjectTypeAnnotation", "type": "ObjectTypeAnnotation",
@ -972,7 +978,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
] ]
}, },
@ -982,7 +989,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -213,7 +213,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": true "exact": true,
"inexact": false
} }
} }
}, },
@ -532,7 +533,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": true "exact": true,
"inexact": false
} }
} }
}, },
@ -744,7 +746,8 @@
"properties": [], "properties": [],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": true "exact": true,
"inexact": false
} }
} }
}, },
@ -1003,7 +1006,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": true "exact": true,
"inexact": false
}, },
"variance": null, "variance": null,
"optional": false "optional": false
@ -1064,7 +1068,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },
@ -1537,7 +1542,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
}, },
"variance": null, "variance": null,
"optional": false "optional": false
@ -1598,7 +1604,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": true "exact": true,
"inexact": false
} }
} }
}, },

View File

@ -166,7 +166,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -166,7 +166,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -195,7 +195,8 @@
} }
], ],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -195,7 +195,8 @@
} }
], ],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -128,7 +128,8 @@
} }
], ],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -160,7 +160,8 @@
} }
], ],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -110,7 +110,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -130,7 +130,8 @@
"properties": [], "properties": [],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
}, },
"variance": null, "variance": null,
"optional": false "optional": false
@ -167,13 +168,15 @@
"properties": [], "properties": [],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -276,7 +276,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -96,7 +96,8 @@
"properties": [], "properties": [],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
}, },
"body": { "body": {

View File

@ -160,7 +160,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -160,7 +160,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -225,7 +225,8 @@
} }
], ],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -174,7 +174,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
} }

View File

@ -213,7 +213,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -211,7 +211,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
}, },
"variance": null, "variance": null,
"optional": false "optional": false
@ -219,7 +220,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -225,7 +225,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
}, },
"variance": null, "variance": null,
@ -234,7 +235,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -213,7 +213,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -213,7 +213,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -235,7 +235,8 @@
} }
], ],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -322,7 +322,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -295,7 +295,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -215,7 +215,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -215,7 +215,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -220,7 +220,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
} }

View File

@ -266,7 +266,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
}, },

View File

@ -151,7 +151,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
}, },
{ {
@ -309,7 +310,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
}, },
{ {
@ -433,7 +435,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
}, },
{ {
@ -590,7 +593,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
}, },
{ {
@ -693,7 +697,8 @@
"properties": [], "properties": [],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
}, },
{ {
@ -896,7 +901,8 @@
"properties": [], "properties": [],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
}, },
{ {

View File

@ -492,7 +492,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
} }
], ],

View File

@ -323,7 +323,8 @@
], ],
"indexers": [], "indexers": [],
"internalSlots": [], "internalSlots": [],
"exact": false "exact": false,
"inexact": false
} }
}, },
"extra": { "extra": {

View File

@ -277,6 +277,10 @@ defineType("ObjectTypeAnnotation", {
validate: assertValueType("boolean"), validate: assertValueType("boolean"),
default: false, default: false,
}, },
// If the inexact flag is present then this is an object type, and not a
// declare class, declare interface, or interface. If it is true, the
// object uses ... to express that it is inexact.
inexact: validateOptional(assertValueType("boolean")),
}, },
}); });