Skip to content

Commit 3d45944

Browse files
committed
Rename 'assertions' to 'attributes' in JS extractor
1 parent bd62ec2 commit 3d45944

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

javascript/extractor/lib/typescript/src/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ const astProperties: string[] = [
224224
"argument",
225225
"argumentExpression",
226226
"arguments",
227-
"assertClause",
228227
"assertsModifier",
229228
"asteriskToken",
230229
"attributes",

javascript/extractor/src/com/semmle/ts/extractor/TypeScriptASTConverter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,16 +1201,16 @@ private Node convertExportAssignment(JsonObject node, SourceLocation loc) throws
12011201

12021202
private Node convertExportDeclaration(JsonObject node, SourceLocation loc) throws ParseError {
12031203
Literal source = tryConvertChild(node, "moduleSpecifier", Literal.class);
1204-
Expression assertion = convertChild(node, "assertClause");
1204+
Expression attributes = convertChild(node, "attributes");
12051205
if (hasChild(node, "exportClause")) {
12061206
boolean hasTypeKeyword = node.get("isTypeOnly").getAsBoolean();
12071207
List<ExportSpecifier> specifiers =
12081208
hasKind(node.get("exportClause"), "NamespaceExport")
12091209
? Collections.singletonList(convertChild(node, "exportClause"))
12101210
: convertChildren(node.get("exportClause").getAsJsonObject(), "elements");
1211-
return new ExportNamedDeclaration(loc, null, specifiers, source, assertion, hasTypeKeyword);
1211+
return new ExportNamedDeclaration(loc, null, specifiers, source, attributes, hasTypeKeyword);
12121212
} else {
1213-
return new ExportAllDeclaration(loc, source, assertion);
1213+
return new ExportAllDeclaration(loc, source, attributes);
12141214
}
12151215
}
12161216

@@ -1393,7 +1393,7 @@ private Node convertImportClause(JsonObject node, SourceLocation loc) throws Par
13931393

13941394
private Node convertImportDeclaration(JsonObject node, SourceLocation loc) throws ParseError {
13951395
Literal src = tryConvertChild(node, "moduleSpecifier", Literal.class);
1396-
Expression assertion = convertChild(node, "assertClause");
1396+
Expression attributes = convertChild(node, "attributes");
13971397
List<ImportSpecifier> specifiers = new ArrayList<>();
13981398
boolean hasTypeKeyword = false;
13991399
if (hasChild(node, "importClause")) {
@@ -1412,7 +1412,7 @@ private Node convertImportDeclaration(JsonObject node, SourceLocation loc) throw
14121412
hasTypeKeyword = importClause.get("isTypeOnly").getAsBoolean();
14131413
}
14141414
ImportDeclaration importDecl =
1415-
new ImportDeclaration(loc, specifiers, src, assertion, hasTypeKeyword);
1415+
new ImportDeclaration(loc, specifiers, src, attributes, hasTypeKeyword);
14161416
attachSymbolInformation(importDecl, node);
14171417
return importDecl;
14181418
}

0 commit comments

Comments
 (0)