hermes-parser 0.15.1 → 0.16.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.
@@ -1,797 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _HermesASTAdapter = _interopRequireDefault(require("./HermesASTAdapter"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
- /**
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- *
18
- *
19
- * @format
20
- */
21
- function createDefaultPosition() {
22
- return {
23
- line: 1,
24
- column: 0
25
- };
26
- }
27
-
28
- function createSyntaxError(node, err) {
29
- const syntaxError = new SyntaxError(err); // $FlowExpectedError[prop-missing]
30
-
31
- syntaxError.loc = {
32
- line: node.loc.start.line,
33
- column: node.loc.start.column
34
- };
35
- return syntaxError;
36
- }
37
-
38
- class HermesToBabelAdapter extends _HermesASTAdapter.default {
39
- fixSourceLocation(node) {
40
- var _this$sourceFilename;
41
-
42
- const loc = node.loc;
43
-
44
- if (loc == null) {
45
- return;
46
- }
47
-
48
- node.loc = {
49
- source: (_this$sourceFilename = this.sourceFilename) != null ? _this$sourceFilename : null,
50
- start: loc.start,
51
- end: loc.end
52
- };
53
-
54
- if (node.start == null) {
55
- node.start = loc.rangeStart;
56
- }
57
-
58
- if (node.end == null) {
59
- node.end = loc.rangeEnd;
60
- }
61
- }
62
-
63
- mapNode(node) {
64
- this.fixSourceLocation(node);
65
-
66
- switch (node.type) {
67
- case 'Program':
68
- return this.mapProgram(node);
69
-
70
- case 'BlockStatement':
71
- return this.mapNodeWithDirectives(node);
72
-
73
- case 'Empty':
74
- return this.mapEmpty(node);
75
-
76
- case 'Identifier':
77
- return this.mapIdentifier(node);
78
-
79
- case 'TemplateElement':
80
- return this.mapTemplateElement(node);
81
-
82
- case 'GenericTypeAnnotation':
83
- return this.mapGenericTypeAnnotation(node);
84
-
85
- case 'SymbolTypeAnnotation':
86
- return this.mapSymbolTypeAnnotation(node);
87
-
88
- case 'Property':
89
- return this.mapProperty(node);
90
-
91
- case 'MethodDefinition':
92
- return this.mapMethodDefinition(node);
93
-
94
- case 'ImportDeclaration':
95
- return this.mapImportDeclaration(node);
96
-
97
- case 'ImportSpecifier':
98
- return this.mapImportSpecifier(node);
99
-
100
- case 'ExportDefaultDeclaration':
101
- return this.mapExportDefaultDeclaration(node);
102
-
103
- case 'ExportNamedDeclaration':
104
- return this.mapExportNamedDeclaration(node);
105
-
106
- case 'ExportNamespaceSpecifier':
107
- return this.mapExportNamespaceSpecifier(node);
108
-
109
- case 'ExportAllDeclaration':
110
- return this.mapExportAllDeclaration(node);
111
-
112
- case 'RestElement':
113
- return this.mapRestElement(node);
114
-
115
- case 'ImportExpression':
116
- return this.mapImportExpression(node);
117
-
118
- case 'JSXStringLiteral':
119
- return this.mapJSXStringLiteral(node);
120
-
121
- case 'PrivateName':
122
- return this.mapPrivateName(node);
123
-
124
- case 'ClassPrivateProperty':
125
- return this.mapPrivateProperty(node);
126
-
127
- case 'FunctionDeclaration':
128
- case 'FunctionExpression':
129
- return this.mapFunction(node);
130
-
131
- case 'IndexedAccessType':
132
- case 'OptionalIndexedAccessType':
133
- case 'KeyofTypeAnnotation':
134
- case 'ConditionalTypeAnnotation':
135
- case 'InferTypeAnnotation':
136
- case 'TupleTypeLabeledElement':
137
- case 'TupleTypeSpreadElement':
138
- case 'ObjectTypeMappedTypeProperty':
139
- case 'ComponentTypeAnnotation':
140
- case 'TypePredicate':
141
- return this.mapUnsupportedTypeAnnotation(node);
142
-
143
- case 'BigIntLiteral':
144
- return this.mapBigIntLiteral(node);
145
-
146
- case 'BigIntLiteralTypeAnnotation':
147
- return this.mapBigIntLiteralTypeAnnotation(node);
148
-
149
- case 'BigIntTypeAnnotation':
150
- return this.mapBigIntTypeAnnotation(node);
151
-
152
- case 'TypeofTypeAnnotation':
153
- return this.mapTypeofTypeAnnotation(node);
154
-
155
- case 'QualifiedTypeofIdentifier':
156
- return this.mapQualifiedTypeofIdentifier(node);
157
-
158
- case 'DeclareVariable':
159
- return this.mapDeclareVariable(node);
160
-
161
- case 'DeclareEnum':
162
- return this.mapDeclareEnum(node);
163
-
164
- case 'DeclareComponent':
165
- return this.mapDeclareComponent(node);
166
-
167
- case 'JSXElement':
168
- return this.mapJSXElement(node);
169
-
170
- case 'ComponentDeclaration':
171
- return this.mapComponentDeclaration(node);
172
-
173
- default:
174
- return this.mapNodeDefault(node);
175
- }
176
- }
177
-
178
- mapProgram(node) {
179
- // Visit child nodes and convert to directives
180
- const {
181
- comments,
182
- ...program
183
- } = this.mapNodeWithDirectives(node);
184
- program.sourceType = this.getSourceType(); // Adjust start loc to beginning of file
185
-
186
- program.loc.start = {
187
- line: 1,
188
- column: 0
189
- };
190
- program.start = 0; // Adjust end loc to include last comment if program ends with a comment
191
-
192
- if (comments.length > 0) {
193
- const lastComment = comments[comments.length - 1];
194
-
195
- if (lastComment.end > program.end) {
196
- program.loc.end = lastComment.loc.end;
197
- program.end = lastComment.end;
198
- }
199
- } // Rename root node to File node and move Program node under program property
200
-
201
-
202
- return {
203
- type: 'File',
204
- loc: program.loc,
205
- start: program.start,
206
- end: program.end,
207
- program,
208
- comments
209
- };
210
- }
211
-
212
- mapNodeWithDirectives(node) {
213
- const directives = [];
214
-
215
- for (const child of node.body) {
216
- if (child.type === 'ExpressionStatement' && child.directive != null) {
217
- // Visit directive children
218
- const directiveChild = this.mapNode(child); // Modify string literal node to be DirectiveLiteral node
219
-
220
- directiveChild.expression.type = 'DirectiveLiteral'; // Construct Directive node with DirectiveLiteral value
221
-
222
- directives.push({
223
- type: 'Directive',
224
- loc: directiveChild.loc,
225
- start: directiveChild.start,
226
- end: directiveChild.end,
227
- value: directiveChild.expression
228
- });
229
- } else {
230
- // Once we have found the first non-directive node we know there cannot be any more directives
231
- break;
232
- }
233
- } // Move directives from body to new directives array
234
-
235
-
236
- node.directives = directives;
237
-
238
- if (directives.length !== 0) {
239
- node.body = node.body.slice(directives.length);
240
- } // Visit expression statement children
241
-
242
-
243
- const body = node.body;
244
-
245
- for (let i = 0; i < body.length; i++) {
246
- const child = body[i];
247
-
248
- if (child != null) {
249
- body[i] = this.mapNode(child);
250
- }
251
- }
252
-
253
- return node;
254
- }
255
-
256
- mapIdentifier(node) {
257
- node.loc.identifierName = node.name;
258
- return this.mapNodeDefault(node);
259
- }
260
-
261
- mapTemplateElement(node) {
262
- // Adjust start loc to exclude "`" at beginning of template literal if this is the first quasi,
263
- // otherwise exclude "}" from previous expression.
264
- const startCharsToExclude = 1; // Adjust end loc to exclude "`" at end of template literal if this is the last quasi,
265
- // otherwise exclude "${" from next expression.
266
-
267
- const endCharsToExclude = node.tail ? 1 : 2;
268
- return {
269
- type: 'TemplateElement',
270
- loc: {
271
- start: {
272
- line: node.loc.start.line,
273
- column: node.loc.start.column + startCharsToExclude
274
- },
275
- end: {
276
- line: node.loc.end.line,
277
- column: node.loc.end.column - endCharsToExclude
278
- }
279
- },
280
- start: node.start + startCharsToExclude,
281
- end: node.end - endCharsToExclude,
282
- tail: node.tail,
283
- value: {
284
- cooked: node.cooked,
285
- raw: node.raw
286
- }
287
- };
288
- }
289
-
290
- mapGenericTypeAnnotation(node) {
291
- // Convert simple `this` generic type to ThisTypeAnnotation
292
- if (node.typeParameters == null && node.id.type === 'Identifier' && node.id.name === 'this') {
293
- return {
294
- type: 'ThisTypeAnnotation',
295
- loc: node.loc,
296
- start: node.start,
297
- end: node.end
298
- };
299
- }
300
-
301
- return this.mapNodeDefault(node);
302
- }
303
-
304
- mapSymbolTypeAnnotation(node) {
305
- return {
306
- type: 'GenericTypeAnnotation',
307
- loc: node.loc,
308
- start: node.start,
309
- end: node.end,
310
- id: {
311
- type: 'Identifier',
312
- loc: node.loc,
313
- start: node.start,
314
- end: node.end,
315
- name: 'symbol'
316
- },
317
- typeParameters: null
318
- };
319
- }
320
-
321
- mapProperty(node) {
322
- const key = this.mapNode(node.key);
323
- const value = this.mapNode(node.value); // Convert methods, getters, and setters to ObjectMethod nodes
324
-
325
- if (node.method || node.kind !== 'init') {
326
- // Properties under the FunctionExpression value that should be moved
327
- // to the ObjectMethod node itself.
328
- const {
329
- id,
330
- params,
331
- body,
332
- async,
333
- generator,
334
- returnType,
335
- typeParameters,
336
- predicate
337
- } = value;
338
- const newNode = {
339
- type: 'ObjectMethod',
340
- loc: node.loc,
341
- start: node.start,
342
- end: node.end,
343
- // Non getter or setter methods have `kind = method`
344
- kind: node.kind === 'init' ? 'method' : node.kind,
345
- method: node.kind === 'init' ? true : false,
346
- computed: node.computed,
347
- key,
348
- id,
349
- params,
350
- body,
351
- async,
352
- generator,
353
- returnType,
354
- typeParameters,
355
- predicate
356
- };
357
-
358
- if (node.kind !== 'init') {
359
- // babel emits an empty variance property on accessors for some reason
360
- newNode.variance = null;
361
- }
362
-
363
- return newNode;
364
- } else {
365
- // Non-method property nodes should be renamed to ObjectProperty
366
- node.type = 'ObjectProperty';
367
- return node;
368
- }
369
- }
370
-
371
- mapMethodDefinition(node) {
372
- const key = this.mapNode(node.key);
373
- const value = this.mapNode(node.value); // Properties under the FunctionExpression value that should be moved
374
- // to the ClassMethod node itself.
375
-
376
- const {
377
- id,
378
- params,
379
- body,
380
- async,
381
- generator,
382
- returnType,
383
- typeParameters,
384
- predicate
385
- } = value;
386
- return {
387
- type: key.type === 'PrivateName' ? 'ClassPrivateMethod' : 'ClassMethod',
388
- loc: node.loc,
389
- start: node.start,
390
- end: node.end,
391
- kind: node.kind,
392
- computed: node.computed,
393
- static: node.static,
394
- key,
395
- id,
396
- params,
397
- body,
398
- async,
399
- generator,
400
- returnType,
401
- typeParameters,
402
- predicate
403
- };
404
- }
405
-
406
- mapRestElement(node) {
407
- const restElement = this.mapNodeDefault(node); // Hermes puts type annotations on rest elements on the argument node,
408
- // but Babel expects type annotations on the rest element node itself.
409
-
410
- const annotation = restElement.argument.typeAnnotation;
411
-
412
- if (annotation != null) {
413
- restElement.typeAnnotation = annotation;
414
- restElement.argument.typeAnnotation = null; // Unfortunately there's no way for us to recover the end location of
415
- // the argument for the general case
416
-
417
- if (restElement.argument.type === 'Identifier') {
418
- restElement.argument.end = restElement.argument.start + restElement.argument.name.length;
419
- restElement.argument.loc.end = { ...restElement.argument.loc.start,
420
- column: restElement.argument.loc.start.column + restElement.argument.name.length
421
- };
422
- }
423
- }
424
-
425
- return restElement;
426
- }
427
-
428
- mapImportExpression(node) {
429
- // Babel expects ImportExpression to be structued as a regular
430
- // CallExpression where the callee is an Import node.
431
- return {
432
- type: 'CallExpression',
433
- loc: node.loc,
434
- start: node.start,
435
- end: node.end,
436
- callee: {
437
- type: 'Import',
438
- loc: { ...node.loc,
439
- end: { ...node.loc.start,
440
- column: node.loc.start.column + 'import'.length
441
- }
442
- },
443
- start: node.start,
444
- end: node.start + 'import'.length
445
- },
446
- arguments: [this.mapNode(node.source)]
447
- };
448
- }
449
-
450
- mapJSXStringLiteral(node) {
451
- // Babel expects StringLiterals in JSX,
452
- // but Hermes uses JSXStringLiteral to attach the raw value without
453
- // having to internally attach it to every single string literal.
454
- return {
455
- type: 'StringLiteral',
456
- loc: node.loc,
457
- start: node.start,
458
- end: node.end,
459
- value: node.value
460
- };
461
- }
462
-
463
- mapFunction(node) {
464
- // Remove the first parameter if it is a this-type annotation,
465
- // which is not recognized by Babel.
466
- if (node.params.length !== 0 && node.params[0].name === 'this') {
467
- node.params.shift();
468
- }
469
-
470
- return this.mapNodeDefault(node);
471
- }
472
- /**
473
- * If Babel (the version we target) does not support a type annotation we
474
- * parse, we need to return some other valid type annotation in its place.
475
- */
476
-
477
-
478
- mapUnsupportedTypeAnnotation(node) {
479
- return {
480
- type: 'AnyTypeAnnotation',
481
- loc: node.loc,
482
- start: node.start,
483
- end: node.end
484
- };
485
- }
486
-
487
- mapBigIntLiteral(node) {
488
- node.value = this.getBigIntLiteralValue(node.bigint).value;
489
- return node;
490
- }
491
-
492
- mapBigIntLiteralTypeAnnotation(node) {
493
- node.value = this.getBigIntLiteralValue(node.raw).value;
494
- return node;
495
- }
496
- /**
497
- * Babel does not parse the bigint keyword type as the keyword node.
498
- * So we need to down-level the AST to a plain GenericTypeAnnotation
499
- */
500
-
501
-
502
- mapBigIntTypeAnnotation(node) {
503
- return {
504
- type: 'GenericTypeAnnotation',
505
- id: {
506
- type: 'Identifier',
507
- name: 'bigint',
508
- loc: node.loc,
509
- start: node.start,
510
- end: node.end
511
- },
512
- typeParameters: null,
513
- loc: node.loc,
514
- start: node.start,
515
- end: node.end
516
- };
517
- }
518
-
519
- mapPrivateProperty(nodeUnprocessed) {
520
- const node = this.mapNodeDefault(nodeUnprocessed);
521
- node.key = {
522
- type: 'PrivateName',
523
- id: { ...node.key,
524
- // babel doesn't include the hash in the identifier
525
- start: node.key.start + 1,
526
- loc: { ...node.key.loc,
527
- start: { ...node.key.loc.start,
528
- column: node.key.loc.start.column + 1
529
- }
530
- }
531
- },
532
- start: node.key.start,
533
- end: node.key.end,
534
- loc: node.key.loc
535
- };
536
- return node;
537
- }
538
-
539
- mapPrivateName(node) {
540
- // babel doesn't include the hash in the identifier
541
- node.id.start += 1;
542
- node.id.loc.start.column += 1;
543
- return node;
544
- }
545
-
546
- mapExportNamespaceSpecifier(nodeUnprocessed) {
547
- const node = this.mapNodeDefault(nodeUnprocessed); // the hermes AST emits the location as the location of the entire export
548
- // but babel emits the location as *just* the "* as id" bit
549
- // the end will always align with the end of the identifier (ezpz)
550
- // but the start will align with the "*" token - which we can't recover from just the AST
551
- // so we just fudge the start location a bit to get it "good enough"
552
- // it will be wrong if the AST is anything like "export * as x from 'y'"... but oh well
553
-
554
- node.start = node.start + 'export '.length;
555
- node.loc.start.column = node.loc.start.column + 'export '.length;
556
- node.end = node.exported.end;
557
- node.loc.end = {
558
- column: node.exported.loc.end.column,
559
- line: node.exported.loc.end.line
560
- };
561
- return node;
562
- }
563
-
564
- mapTypeofTypeAnnotation(nodeUnprocessed) {
565
- nodeUnprocessed.argument = {
566
- type: 'GenericTypeAnnotation',
567
- id: nodeUnprocessed.argument,
568
- typeParameters: null,
569
- loc: nodeUnprocessed.argument.loc
570
- };
571
- return this.mapNodeDefault(nodeUnprocessed);
572
- }
573
-
574
- mapQualifiedTypeofIdentifier(nodeUnprocessed) {
575
- nodeUnprocessed.type = 'QualifiedTypeIdentifier';
576
- return this.mapNodeDefault(nodeUnprocessed);
577
- }
578
-
579
- mapDeclareVariable(nodeUnprocessed) {
580
- delete nodeUnprocessed.kind;
581
- return this.mapNodeDefault(nodeUnprocessed);
582
- }
583
-
584
- mapDeclareEnum(nodeUnprocessed) {
585
- nodeUnprocessed.id.typeAnnotation = this.mapUnsupportedTypeAnnotation(nodeUnprocessed.body);
586
- delete nodeUnprocessed.body;
587
- nodeUnprocessed.type = 'DeclareVariable';
588
- return this.mapDeclareVariable(nodeUnprocessed);
589
- }
590
-
591
- mapDeclareComponent(nodeUnprocessed) {
592
- nodeUnprocessed.id.typeAnnotation = this.mapUnsupportedTypeAnnotation(nodeUnprocessed);
593
- delete nodeUnprocessed.params;
594
- delete nodeUnprocessed.rest;
595
- delete nodeUnprocessed.typeParameters;
596
- delete nodeUnprocessed.rendersType;
597
- nodeUnprocessed.type = 'DeclareVariable';
598
- return this.mapDeclareVariable(nodeUnprocessed);
599
- }
600
-
601
- mapJSXElement(nodeUnprocessed) {
602
- delete nodeUnprocessed.openingElement.typeArguments;
603
- return this.mapNodeDefault(nodeUnprocessed);
604
- }
605
-
606
- mapComponentDeclaration(nodeUnprocessed) {
607
- let rendersType = nodeUnprocessed.rendersType;
608
-
609
- if (rendersType == null) {
610
- // Create empty loc for return type annotation nodes
611
- const createRendersTypeLoc = () => ({
612
- loc: {
613
- start: { ...nodeUnprocessed.body.loc.end
614
- },
615
- end: { ...nodeUnprocessed.body.loc.end
616
- },
617
- rangeStart: nodeUnprocessed.body.loc.rangeStart,
618
- rangeEnd: nodeUnprocessed.body.loc.rangeEnd
619
- }
620
- });
621
-
622
- rendersType = {
623
- type: 'TypeAnnotation',
624
- typeAnnotation: {
625
- type: 'GenericTypeAnnotation',
626
- id: {
627
- type: 'QualifiedTypeIdentifier',
628
- qualification: {
629
- type: 'Identifier',
630
- name: 'React',
631
- ...createRendersTypeLoc()
632
- },
633
- id: {
634
- type: 'Identifier',
635
- name: 'Node',
636
- ...createRendersTypeLoc()
637
- },
638
- ...createRendersTypeLoc()
639
- },
640
- typeParameters: null,
641
- ...createRendersTypeLoc()
642
- },
643
- ...createRendersTypeLoc()
644
- };
645
- }
646
-
647
- function getParamName(paramName) {
648
- switch (paramName.type) {
649
- case 'Identifier':
650
- return paramName.name;
651
-
652
- case 'StringLiteral':
653
- return paramName.value;
654
-
655
- default:
656
- throw createSyntaxError(paramName, `Unknown Component parameter name type of "${paramName.type}"`);
657
- }
658
- }
659
-
660
- function createPropsTypeAnnotation(loc) {
661
- // Create empty loc for type annotation nodes
662
- const createParamsTypeLoc = () => ({
663
- loc: {
664
- start: loc.start != null ? { ...loc.start
665
- } : createDefaultPosition(),
666
- end: loc.end != null ? { ...loc.end
667
- } : createDefaultPosition(),
668
- rangeStart: loc.rangeStart,
669
- rangeEnd: loc.rangeEnd
670
- }
671
- });
672
-
673
- return {
674
- type: 'TypeAnnotation',
675
- typeAnnotation: {
676
- type: 'GenericTypeAnnotation',
677
- id: {
678
- type: 'Identifier',
679
- name: '$ReadOnly',
680
- ...createParamsTypeLoc()
681
- },
682
- typeParameters: {
683
- type: 'TypeParameterInstantiation',
684
- params: [{
685
- type: 'ObjectTypeAnnotation',
686
- callProperties: [],
687
- properties: [],
688
- indexers: [],
689
- internalSlots: [],
690
- exact: false,
691
- inexact: true,
692
- ...createParamsTypeLoc()
693
- }],
694
- ...createParamsTypeLoc()
695
- },
696
- ...createParamsTypeLoc()
697
- },
698
- ...createParamsTypeLoc()
699
- };
700
- }
701
-
702
- const params = (() => {
703
- if (nodeUnprocessed.params.length === 0) {
704
- return [];
705
- } // Optimize `component Foo(...props: Props) {}` to `function Foo(props: Props) {}
706
-
707
-
708
- if (nodeUnprocessed.params.length === 1 && nodeUnprocessed.params[0].type === 'RestElement') {
709
- const restElement = nodeUnprocessed.params[0];
710
- return [{ ...restElement.argument,
711
- typeAnnotation: createPropsTypeAnnotation(restElement.argument.typeAnnotation.loc)
712
- }];
713
- }
714
-
715
- const properties = nodeUnprocessed.params.map(param => {
716
- switch (param.type) {
717
- case 'RestElement':
718
- {
719
- delete param.typeAnnotation;
720
- return param;
721
- }
722
-
723
- case 'ComponentParameter':
724
- {
725
- if (getParamName(param.name) === 'ref') {
726
- throw createSyntaxError(param, 'Component parameters named "ref" are currently not supported');
727
- }
728
-
729
- if (param.name.type === 'Identifier') {
730
- delete param.name.typeAnnotation;
731
- }
732
-
733
- if (param.local.type === 'AssignmentPattern') {
734
- delete param.local.left.typeAnnotation;
735
- delete param.local.left.optional;
736
- } else {
737
- delete param.local.typeAnnotation;
738
- delete param.local.optional;
739
- }
740
-
741
- return {
742
- type: 'ObjectProperty',
743
- key: param.name,
744
- value: param.local,
745
- method: false,
746
- shorthand: param.shorthand,
747
- computed: false,
748
- loc: param.loc,
749
- start: param.start,
750
- end: param.end
751
- };
752
- }
753
-
754
- default:
755
- {
756
- throw createSyntaxError(param, `Unknown Component parameter type of "${param.type}"`);
757
- }
758
- }
759
- });
760
- const paramsLoc = {
761
- start: properties[0].loc.start,
762
- end: properties[properties.length - 1].loc.end,
763
- rangeStart: properties[0].loc.rangeStart,
764
- rangeEnd: properties[properties.length - 1].loc.rangeEnd
765
- };
766
- return [{
767
- type: 'ObjectPattern',
768
- properties,
769
- typeAnnotation: createPropsTypeAnnotation({ ...paramsLoc,
770
- start: paramsLoc.end,
771
- rangeStart: paramsLoc.rangeEnd
772
- }),
773
- loc: paramsLoc
774
- }];
775
- })();
776
-
777
- const functionComponent = {
778
- type: 'FunctionDeclaration',
779
- __componentDeclaration: true,
780
- id: nodeUnprocessed.id,
781
- typeParameters: nodeUnprocessed.typeParameters,
782
- params,
783
- returnType: rendersType,
784
- body: nodeUnprocessed.body,
785
- async: false,
786
- generator: false,
787
- predicate: null,
788
- loc: nodeUnprocessed.loc,
789
- start: nodeUnprocessed.start,
790
- end: nodeUnprocessed.end
791
- };
792
- return this.mapNodeDefault(functionComponent);
793
- }
794
-
795
- }
796
-
797
- exports.default = HermesToBabelAdapter;