|
125 | 125 | body: normalize_directives(from_moz(M.body).body),
|
126 | 126 | });
|
127 | 127 | },
|
| 128 | + CallExpression: function(M) { |
| 129 | + return new AST_Call({ |
| 130 | + start: my_start_token(M), |
| 131 | + end: my_end_token(M), |
| 132 | + expression: from_moz(M.callee), |
| 133 | + args: M.arguments.map(from_moz), |
| 134 | + optional: M.optional, |
| 135 | + pure: M.pure, |
| 136 | + }); |
| 137 | + }, |
128 | 138 | ClassDeclaration: function(M) {
|
129 | 139 | return new AST_DefClass({
|
130 | 140 | start: my_start_token(M),
|
|
458 | 468 | end: my_end_token(M),
|
459 | 469 | };
|
460 | 470 | if (M.bigint) {
|
461 |
| - args.value = M.bigint.toLowerCase() + "n"; |
| 471 | + args.value = M.bigint.toLowerCase(); |
462 | 472 | return new AST_BigInt(args);
|
463 | 473 | }
|
464 | 474 | var val = M.value;
|
|
631 | 641 | map("AssignmentPattern", AST_DefaultValue, "left>name, right>value");
|
632 | 642 | map("ConditionalExpression", AST_Conditional, "test>condition, consequent>consequent, alternate>alternative");
|
633 | 643 | map("NewExpression", AST_New, "callee>expression, arguments@args, pure=pure");
|
634 |
| - map("CallExpression", AST_Call, "callee>expression, arguments@args, optional=optional, pure=pure"); |
635 | 644 | map("SequenceExpression", AST_Sequence, "expressions@expressions");
|
636 | 645 | map("SpreadElement", AST_Spread, "argument>expression");
|
637 | 646 | map("ObjectExpression", AST_Object, "properties@properties");
|
|
668 | 677 | type: "ArrowFunctionExpression",
|
669 | 678 | async: is_async(M),
|
670 | 679 | params: params,
|
| 680 | + expression: !!M.value, |
671 | 681 | body: M.value ? to_moz(M.value) : to_moz_scope("BlockStatement", M),
|
672 | 682 | };
|
673 | 683 | return {
|
|
680 | 690 | };
|
681 | 691 | });
|
682 | 692 |
|
| 693 | + def_to_moz(AST_Call, function To_Moz_CallExpression(M) { |
| 694 | + var expr = M.expression; |
| 695 | + if (M.args.length == 1 && expr instanceof AST_SymbolRef && expr.name == "import") return { |
| 696 | + type: "ImportExpression", |
| 697 | + source: to_moz(M.args[0]), |
| 698 | + }; |
| 699 | + return { |
| 700 | + type: "CallExpression", |
| 701 | + callee: to_moz(expr), |
| 702 | + arguments: M.args.map(to_moz), |
| 703 | + optional: M.optional, |
| 704 | + pure: M.pure, |
| 705 | + }; |
| 706 | + }); |
| 707 | + |
683 | 708 | def_to_moz(AST_DefClass, function To_Moz_ClassDeclaration(M) {
|
684 | 709 | return {
|
685 | 710 | type: "ClassDeclaration",
|
|
767 | 792 | def_to_moz(AST_Directive, function To_Moz_Directive(M) {
|
768 | 793 | return {
|
769 | 794 | type: "ExpressionStatement",
|
| 795 | + directive: M.value, |
770 | 796 | expression: set_moz_loc(M, {
|
771 | 797 | type: "Literal",
|
772 | 798 | value: M.value,
|
|
787 | 813 | type: "TryStatement",
|
788 | 814 | block: to_moz_block(M),
|
789 | 815 | handler: to_moz(M.bcatch),
|
790 |
| - guardedHandlers: [], |
791 | 816 | finalizer: to_moz(M.bfinally),
|
792 | 817 | };
|
793 | 818 | });
|
|
796 | 821 | return {
|
797 | 822 | type: "CatchClause",
|
798 | 823 | param: to_moz(M.argname),
|
799 |
| - guard: null, |
800 | 824 | body: to_moz_block(M),
|
801 | 825 | };
|
802 | 826 | });
|
|
805 | 829 | return {
|
806 | 830 | type: "ExportNamedDeclaration",
|
807 | 831 | declaration: to_moz(M.body),
|
| 832 | + specifiers: [], |
808 | 833 | };
|
809 | 834 | });
|
810 | 835 |
|
|
954 | 979 | type: "Property",
|
955 | 980 | kind: "init",
|
956 | 981 | computed: computed,
|
| 982 | + method: false, |
| 983 | + shorthand: false, |
957 | 984 | key: key,
|
958 | 985 | value: to_moz(M.value),
|
959 | 986 | };
|
|
990 | 1017 | kind: kind,
|
991 | 1018 | computed: computed,
|
992 | 1019 | method: M instanceof AST_ObjectMethod,
|
| 1020 | + shorthand: false, |
993 | 1021 | key: key,
|
994 | 1022 | value: to_moz(M.value),
|
995 | 1023 | };
|
|
1043 | 1071 | var value = M.value;
|
1044 | 1072 | return {
|
1045 | 1073 | type: "Literal",
|
1046 |
| - bigint: value.slice(0, -1), |
1047 |
| - raw: value, |
| 1074 | + bigint: value, |
| 1075 | + raw: value + "n", |
1048 | 1076 | };
|
1049 | 1077 | });
|
1050 | 1078 |
|
|
0 commit comments