@@ -342,7 +342,7 @@ private Node convertNodeUntyped(JsonObject node, String defaultKind) throws Pars
342342 return convertArrowFunction (node , loc );
343343 case "AsExpression" :
344344 return convertTypeAssertionExpression (node , loc );
345- case "SatisfiesExpression" :
345+ case "SatisfiesExpression" :
346346 return convertSatisfiesExpression (node , loc );
347347 case "AwaitExpression" :
348348 return convertAwaitExpression (node , loc );
@@ -888,7 +888,7 @@ private Node convertBreakStatement(JsonObject node, SourceLocation loc) throws P
888888 private Node convertCallExpression (JsonObject node , SourceLocation loc ) throws ParseError {
889889 List <Expression > arguments = convertChildren (node , "arguments" );
890890 if (arguments .size () == 1 && hasKind (node .get ("expression" ), "ImportKeyword" )) {
891- return new DynamicImport (loc , arguments .get (0 ));
891+ return new DynamicImport (loc , arguments .get (0 ), null ); // TODO: preserve import attributes
892892 }
893893 Expression callee = convertChild (node , "expression" );
894894 List <ITypeExpression > typeArguments = convertChildrenAsTypes (node , "typeArguments" );
@@ -1199,9 +1199,9 @@ private Node convertExportDeclaration(JsonObject node, SourceLocation loc) throw
11991199 hasKind (node .get ("exportClause" ), "NamespaceExport" )
12001200 ? Collections .singletonList (convertChild (node , "exportClause" ))
12011201 : convertChildren (node .get ("exportClause" ).getAsJsonObject (), "elements" );
1202- return new ExportNamedDeclaration (loc , null , specifiers , source , hasTypeKeyword );
1202+ return new ExportNamedDeclaration (loc , null , specifiers , source , null , hasTypeKeyword ); // TODO: preserve import assertions
12031203 } else {
1204- return new ExportAllDeclaration (loc , source );
1204+ return new ExportAllDeclaration (loc , source , null ); // TODO: preserve import assertions
12051205 }
12061206 }
12071207
@@ -1400,7 +1400,7 @@ private Node convertImportDeclaration(JsonObject node, SourceLocation loc) throw
14001400 }
14011401 hasTypeKeyword = importClause .get ("isTypeOnly" ).getAsBoolean ();
14021402 }
1403- ImportDeclaration importDecl = new ImportDeclaration (loc , specifiers , src , hasTypeKeyword );
1403+ ImportDeclaration importDecl = new ImportDeclaration (loc , specifiers , src , null , hasTypeKeyword ); // TODO: preserve import assertions
14041404 attachSymbolInformation (importDecl , node );
14051405 return importDecl ;
14061406 }
@@ -1746,7 +1746,7 @@ private Node convertNamespaceDeclaration(JsonObject node, SourceLocation loc) th
17461746 if (hasFlag (node , "NestedNamespace" )) {
17471747 // In a nested namespace declaration `namespace A.B`, the nested namespace `B`
17481748 // is implicitly exported.
1749- return new ExportNamedDeclaration (loc , decl , new ArrayList <>(), null );
1749+ return new ExportNamedDeclaration (loc , decl , new ArrayList <>(), null , null ); // TODO: preserve import assertion
17501750 } else {
17511751 return fixExports (loc , decl );
17521752 }
@@ -2455,7 +2455,7 @@ private Node fixExports(SourceLocation loc, Node decl) {
24552455 advance (loc , skipped );
24562456 // capture group 1 is `default`, if present
24572457 if (m .group (1 ) == null )
2458- return new ExportNamedDeclaration (outerLoc , (Statement ) decl , new ArrayList <>(), null );
2458+ return new ExportNamedDeclaration (outerLoc , (Statement ) decl , new ArrayList <>(), null , null ); // TODO: preserve import assertions
24592459 return new ExportDefaultDeclaration (outerLoc , decl );
24602460 }
24612461 return decl ;
0 commit comments