11package com .semmle .js .ast ;
22
3- import java .util .ArrayList ;
4- import java .util .List ;
5-
63import com .semmle .js .ast .jsx .JSXAttribute ;
74import com .semmle .js .ast .jsx .JSXClosingElement ;
85import com .semmle .js .ast .jsx .JSXElement ;
4239import com .semmle .ts .ast .ParenthesizedTypeExpr ;
4340import com .semmle .ts .ast .PredicateTypeExpr ;
4441import com .semmle .ts .ast .RestTypeExpr ;
42+ import com .semmle .ts .ast .SatisfiesExpr ;
4543import com .semmle .ts .ast .TemplateLiteralTypeExpr ;
4644import com .semmle .ts .ast .TupleTypeExpr ;
4745import com .semmle .ts .ast .TypeAliasDeclaration ;
4846import com .semmle .ts .ast .TypeAssertion ;
49- import com .semmle .ts .ast .SatisfiesExpr ;
5047import com .semmle .ts .ast .TypeParameter ;
5148import com .semmle .ts .ast .TypeofTypeExpr ;
5249import com .semmle .ts .ast .UnaryTypeExpr ;
5350import com .semmle .ts .ast .UnionTypeExpr ;
5451import com .semmle .util .data .IntList ;
52+ import java .util .ArrayList ;
53+ import java .util .List ;
5554
5655/** Deep cloning of AST nodes. */
5756public class NodeCopier implements Visitor <Void , INode > {
@@ -429,7 +428,8 @@ public TemplateLiteral visit(TemplateLiteral nd, Void q) {
429428
430429 @ Override
431430 public TemplateLiteralTypeExpr visit (TemplateLiteralTypeExpr nd , Void q ) {
432- return new TemplateLiteralTypeExpr (visit (nd .getLoc ()), copy (nd .getExpressions ()), copy (nd .getQuasis ()));
431+ return new TemplateLiteralTypeExpr (
432+ visit (nd .getLoc ()), copy (nd .getExpressions ()), copy (nd .getQuasis ()));
433433 }
434434
435435 @ Override
@@ -523,7 +523,8 @@ public MetaProperty visit(MetaProperty nd, Void c) {
523523
524524 @ Override
525525 public ExportAllDeclaration visit (ExportAllDeclaration nd , Void c ) {
526- return new ExportAllDeclaration (visit (nd .getLoc ()), copy (nd .getSource ()), copy (nd .getAssertion ()));
526+ return new ExportAllDeclaration (
527+ visit (nd .getLoc ()), copy (nd .getSource ()), copy (nd .getAttributes ()));
527528 }
528529
529530 @ Override
@@ -538,7 +539,7 @@ public ExportNamedDeclaration visit(ExportNamedDeclaration nd, Void c) {
538539 copy (nd .getDeclaration ()),
539540 copy (nd .getSpecifiers ()),
540541 copy (nd .getSource ()),
541- copy (nd .getAssertion ()));
542+ copy (nd .getAttributes ()));
542543 }
543544
544545 @ Override
@@ -559,7 +560,11 @@ public ExportSpecifier visit(ExportSpecifier nd, Void c) {
559560 @ Override
560561 public ImportDeclaration visit (ImportDeclaration nd , Void c ) {
561562 return new ImportDeclaration (
562- visit (nd .getLoc ()), copy (nd .getSpecifiers ()), copy (nd .getSource ()), copy (nd .getAssertion ()), nd .hasTypeKeyword ());
563+ visit (nd .getLoc ()),
564+ copy (nd .getSpecifiers ()),
565+ copy (nd .getSource ()),
566+ copy (nd .getAttributes ()),
567+ nd .hasTypeKeyword ());
563568 }
564569
565570 @ Override
@@ -725,7 +730,8 @@ public INode visit(ParenthesizedTypeExpr nd, Void c) {
725730
726731 @ Override
727732 public INode visit (TupleTypeExpr nd , Void c ) {
728- return new TupleTypeExpr (visit (nd .getLoc ()), copy (nd .getElementTypes ()), copy (nd .getElementNames ()));
733+ return new TupleTypeExpr (
734+ visit (nd .getLoc ()), copy (nd .getElementTypes ()), copy (nd .getElementNames ()));
729735 }
730736
731737 @ Override
@@ -787,9 +793,7 @@ public INode visit(TypeAssertion nd, Void c) {
787793 @ Override
788794 public INode visit (SatisfiesExpr nd , Void c ) {
789795 return new SatisfiesExpr (
790- visit (nd .getLoc ()),
791- copy (nd .getExpression ()),
792- copy (nd .getTypeAnnotation ()));
796+ visit (nd .getLoc ()), copy (nd .getExpression ()), copy (nd .getTypeAnnotation ()));
793797 }
794798
795799 @ Override
@@ -907,7 +911,8 @@ public INode visit(XMLDotDotExpression nd, Void c) {
907911
908912 @ Override
909913 public INode visit (GeneratedCodeExpr nd , Void c ) {
910- return new GeneratedCodeExpr (visit (nd .getLoc ()), nd .getOpeningDelimiter (), nd .getClosingDelimiter (), nd .getBody ());
914+ return new GeneratedCodeExpr (
915+ visit (nd .getLoc ()), nd .getOpeningDelimiter (), nd .getClosingDelimiter (), nd .getBody ());
911916 }
912917
913918 @ Override
0 commit comments