flow-parser 0.331.0 → 0.333.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -243,6 +243,7 @@ export default class FlowParserDeserializer {
243
243
  }`,
244
244
  );
245
245
  }
246
+ // $FlowFixMe[invalid-this-arg]
246
247
  const node = deserializeNode.call(this);
247
248
  if (this.extendedLocationHeaders) {
248
249
  this.addExtendedRange(node);
@@ -160,17 +160,19 @@ module.exports = [function () {
160
160
  id: this.deserializeNode()
161
161
  };
162
162
  }, function () {
163
- return {
163
+ const node = {
164
164
  type: 'ClassDeclaration',
165
- loc: this.addEmptyLoc(),
166
- id: this.deserializeNode(),
167
- typeParameters: this.deserializeNode(),
168
- superClass: this.deserializeNode(),
169
- implements: this.deserializeNodeList(),
170
- body: this.deserializeNode(),
171
- superTypeArguments: this.deserializeNode(),
172
- decorators: this.deserializeNodeList()
165
+ loc: this.addEmptyLoc()
173
166
  };
167
+ node.id = this.deserializeNode();
168
+ node.typeParameters = this.deserializeNode();
169
+ node.superClass = this.deserializeNode();
170
+ node.implements = this.deserializeNodeList();
171
+ node.body = this.deserializeNode();
172
+ node.superTypeArguments = this.deserializeNode();
173
+ node.decorators = this.deserializeNodeList();
174
+ if (this.deserializeBoolean()) node['abstract'] = true;
175
+ return node;
174
176
  }, function () {
175
177
  return {
176
178
  type: 'ComponentDeclaration',
@@ -233,7 +235,8 @@ module.exports = [function () {
233
235
  specifiers: this.deserializeNodeList(),
234
236
  source: this.deserializeNode(),
235
237
  importKind: this.deserializeString(),
236
- attributes: this.deserializeNodeList()
238
+ attributes: this.deserializeNodeList(),
239
+ phase: this.deserializeString()
237
240
  };
238
241
  }, function () {
239
242
  return {
@@ -305,7 +308,8 @@ module.exports = [function () {
305
308
  type: 'ExportSpecifier',
306
309
  loc: this.addEmptyLoc(),
307
310
  exported: this.deserializeNode(),
308
- local: this.deserializeNode()
311
+ local: this.deserializeNode(),
312
+ exportKind: this.deserializeString()
309
313
  };
310
314
  }, function () {
311
315
  return {
@@ -485,7 +489,8 @@ module.exports = [function () {
485
489
  type: 'ImportExpression',
486
490
  loc: this.addEmptyLoc(),
487
491
  source: this.deserializeNode(),
488
- options: this.deserializeNode()
492
+ options: this.deserializeNode(),
493
+ phase: this.deserializeString()
489
494
  };
490
495
  }, function () {
491
496
  return {
@@ -672,17 +677,19 @@ module.exports = [function () {
672
677
  argument: this.deserializeNode()
673
678
  };
674
679
  }, function () {
675
- return {
680
+ const node = {
676
681
  type: 'ClassExpression',
677
- loc: this.addEmptyLoc(),
678
- id: this.deserializeNode(),
679
- typeParameters: this.deserializeNode(),
680
- superClass: this.deserializeNode(),
681
- implements: this.deserializeNodeList(),
682
- body: this.deserializeNode(),
683
- superTypeArguments: this.deserializeNode(),
684
- decorators: this.deserializeNodeList()
682
+ loc: this.addEmptyLoc()
685
683
  };
684
+ node.id = this.deserializeNode();
685
+ node.typeParameters = this.deserializeNode();
686
+ node.superClass = this.deserializeNode();
687
+ node.implements = this.deserializeNodeList();
688
+ node.body = this.deserializeNode();
689
+ node.superTypeArguments = this.deserializeNode();
690
+ node.decorators = this.deserializeNodeList();
691
+ if (this.deserializeBoolean()) node['abstract'] = true;
692
+ return node;
686
693
  }, function () {
687
694
  return {
688
695
  type: 'ClassBody',
@@ -765,26 +772,34 @@ module.exports = [function () {
765
772
  override: this.deserializeBoolean()
766
773
  };
767
774
  }, function () {
768
- return {
775
+ const node = {
769
776
  type: 'AbstractMethodDefinition',
770
- loc: this.addEmptyLoc(),
771
- key: this.deserializeNode(),
772
- value: this.deserializeNode(),
773
- computed: this.deserializeBoolean(),
774
- override: this.deserializeBoolean(),
775
- tsAccessibility: this.deserializeString()
777
+ loc: this.addEmptyLoc()
776
778
  };
779
+ node.key = this.deserializeNode();
780
+ node.value = this.deserializeNode();
781
+ node.computed = this.deserializeBoolean();
782
+ if (this.deserializeBoolean()) node['override'] = true;
783
+ {
784
+ const value = this.deserializeString();
785
+ if (value != null) node['tsAccessibility'] = value;
786
+ }
787
+ return node;
777
788
  }, function () {
778
- return {
789
+ const node = {
779
790
  type: 'AbstractPropertyDefinition',
780
- loc: this.addEmptyLoc(),
781
- key: this.deserializeNode(),
782
- value: this.deserializeNode(),
783
- computed: this.deserializeBoolean(),
784
- variance: this.deserializeNode(),
785
- override: this.deserializeBoolean(),
786
- tsAccessibility: this.deserializeString()
791
+ loc: this.addEmptyLoc()
787
792
  };
793
+ node.key = this.deserializeNode();
794
+ node.value = this.deserializeNode();
795
+ node.computed = this.deserializeBoolean();
796
+ node.variance = this.deserializeNode();
797
+ if (this.deserializeBoolean()) node['override'] = true;
798
+ {
799
+ const value = this.deserializeString();
800
+ if (value != null) node['tsAccessibility'] = value;
801
+ }
802
+ return node;
788
803
  }, function () {
789
804
  return {
790
805
  type: 'SwitchCase',
@@ -816,25 +831,32 @@ module.exports = [function () {
816
831
  implicitDeclare: this.deserializeBoolean()
817
832
  };
818
833
  }, function () {
819
- return {
834
+ const node = {
820
835
  type: 'DeclareFunction',
821
- loc: this.addEmptyLoc(),
822
- id: this.deserializeNode(),
823
- implicitDeclare: this.deserializeBoolean(),
824
- predicate: this.deserializeNode()
836
+ loc: this.addEmptyLoc()
825
837
  };
838
+ node.id = this.deserializeNode();
839
+ {
840
+ const value = this.deserializeNode();
841
+ if (value != null) node['typeAnnotation'] = value;
842
+ }
843
+ node.implicitDeclare = this.deserializeBoolean();
844
+ node.predicate = this.deserializeNode();
845
+ return node;
826
846
  }, function () {
827
- return {
847
+ const node = {
828
848
  type: 'DeclareClass',
829
- loc: this.addEmptyLoc(),
830
- id: this.deserializeNode(),
831
- typeParameters: this.deserializeNode(),
832
- extends: this.deserializeNodeList(),
833
- implements: this.deserializeNodeList(),
834
- mixins: this.deserializeNodeList(),
835
- body: this.deserializeNode(),
836
- implicitDeclare: this.deserializeBoolean()
849
+ loc: this.addEmptyLoc()
837
850
  };
851
+ node.id = this.deserializeNode();
852
+ node.typeParameters = this.deserializeNode();
853
+ node.extends = this.deserializeNodeList();
854
+ node.implements = this.deserializeNodeList();
855
+ node.mixins = this.deserializeNodeList();
856
+ node.body = this.deserializeNode();
857
+ node.implicitDeclare = this.deserializeBoolean();
858
+ if (this.deserializeBoolean()) node['abstract'] = true;
859
+ return node;
838
860
  }, function () {
839
861
  return {
840
862
  type: 'DeclareComponent',
@@ -1127,7 +1149,7 @@ module.exports = [function () {
1127
1149
  return {
1128
1150
  type: 'ImportType',
1129
1151
  loc: this.addEmptyLoc(),
1130
- argument: this.deserializeNode()
1152
+ source: this.deserializeNode()
1131
1153
  };
1132
1154
  }, function () {
1133
1155
  return {
@@ -1164,18 +1186,30 @@ module.exports = [function () {
1164
1186
  exact: this.deserializeBoolean()
1165
1187
  };
1166
1188
  }, function () {
1167
- return {
1189
+ const node = {
1168
1190
  type: 'ObjectTypeProperty',
1169
- loc: this.addEmptyLoc(),
1170
- key: this.deserializeNode(),
1171
- value: this.deserializeNode(),
1172
- method: this.deserializeBoolean(),
1173
- optional: this.deserializeBoolean(),
1174
- static: this.deserializeBoolean(),
1175
- proto: this.deserializeBoolean(),
1176
- variance: this.deserializeNode(),
1177
- kind: this.deserializeString()
1191
+ loc: this.addEmptyLoc()
1178
1192
  };
1193
+ node.key = this.deserializeNode();
1194
+ node.value = this.deserializeNode();
1195
+ node.method = this.deserializeBoolean();
1196
+ node.optional = this.deserializeBoolean();
1197
+ node.static = this.deserializeBoolean();
1198
+ node.proto = this.deserializeBoolean();
1199
+ node.variance = this.deserializeNode();
1200
+ node.kind = this.deserializeString();
1201
+ if (this.deserializeBoolean()) node['computed'] = true;
1202
+ if (this.deserializeBoolean()) node['abstract'] = true;
1203
+ if (this.deserializeBoolean()) node['override'] = true;
1204
+ {
1205
+ const value = this.deserializeString();
1206
+ if (value != null) node['tsAccessibility'] = value;
1207
+ }
1208
+ {
1209
+ const value = this.deserializeNode();
1210
+ if (value != null) node['init'] = value;
1211
+ }
1212
+ return node;
1179
1213
  }, function () {
1180
1214
  return {
1181
1215
  type: 'ObjectTypeSpreadProperty',
@@ -1190,7 +1224,8 @@ module.exports = [function () {
1190
1224
  key: this.deserializeNode(),
1191
1225
  value: this.deserializeNode(),
1192
1226
  static: this.deserializeBoolean(),
1193
- variance: this.deserializeNode()
1227
+ variance: this.deserializeNode(),
1228
+ optional: this.deserializeBoolean()
1194
1229
  };
1195
1230
  }, function () {
1196
1231
  return {
@@ -1206,7 +1241,9 @@ module.exports = [function () {
1206
1241
  keyTparam: this.deserializeNode(),
1207
1242
  propType: this.deserializeNode(),
1208
1243
  sourceType: this.deserializeNode(),
1244
+ nameType: this.deserializeNode(),
1209
1245
  variance: this.deserializeNode(),
1246
+ varianceOp: this.deserializeString(),
1210
1247
  optional: this.deserializeString()
1211
1248
  };
1212
1249
  }, function () {
@@ -2329,6 +2366,10 @@ module.exports = [function () {
2329
2366
  const value = this.deserializeNodeList();
2330
2367
  if (value.length > 0) node['attributes'] = value;
2331
2368
  }
2369
+ {
2370
+ const value = this.deserializeString();
2371
+ if (value != null) node['phase'] = value;
2372
+ }
2332
2373
  return node;
2333
2374
  }, function () {
2334
2375
  const node = {