Skip to content

Commit 1d9ee5d

Browse files
committed
Rename 'assertions' to 'attributes' in JS extractor
1 parent b936e91 commit 1d9ee5d

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

javascript/extractor/src/com/semmle/jcorn/ESNextParser.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,9 @@ protected ExportDeclaration parseExportRest(SourceLocation exportStart, Set<Stri
314314
this.parseExportSpecifiersMaybe(specifiers, exports);
315315
}
316316
Literal source = (Literal) this.parseExportFrom(specifiers, null, true);
317-
Expression assertion = this.parseImportOrExportAssertionAndSemicolon();
318-
return this.finishNode(new ExportNamedDeclaration(exportStart, null, specifiers, source, assertion));
317+
Expression attributes = this.parseImportOrExportAttributesAndSemicolon();
318+
return this.finishNode(
319+
new ExportNamedDeclaration(exportStart, null, specifiers, source, attributes));
319320
}
320321

321322
return super.parseExportRest(exportStart, exports);
@@ -331,8 +332,9 @@ protected ExportDeclaration parseExportAll(
331332
List<ExportSpecifier> specifiers = CollectionUtil.makeList(nsSpec);
332333
this.parseExportSpecifiersMaybe(specifiers, exports);
333334
Literal source = (Literal) this.parseExportFrom(specifiers, null, true);
334-
Expression assertion = this.parseImportOrExportAssertionAndSemicolon();
335-
return this.finishNode(new ExportNamedDeclaration(exportStart, null, specifiers, source, assertion));
335+
Expression attributes = this.parseImportOrExportAttributesAndSemicolon();
336+
return this.finishNode(
337+
new ExportNamedDeclaration(exportStart, null, specifiers, source, attributes));
336338
}
337339

338340
return super.parseExportAll(exportStart, starLoc, exports);

javascript/extractor/src/com/semmle/jcorn/Parser.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3447,7 +3447,7 @@ protected ExportDeclaration parseExportRest(SourceLocation loc, Set<String> expo
34473447
Statement declaration;
34483448
List<ExportSpecifier> specifiers;
34493449
Expression source = null;
3450-
Expression assertion = null;
3450+
Expression attributes = null;
34513451
if (this.shouldParseExportStatement()) {
34523452
declaration = this.parseStatement(true, false);
34533453
if (declaration == null) return null;
@@ -3463,10 +3463,10 @@ protected ExportDeclaration parseExportRest(SourceLocation loc, Set<String> expo
34633463
declaration = null;
34643464
specifiers = this.parseExportSpecifiers(exports);
34653465
source = parseExportFrom(specifiers, source, false);
3466-
assertion = parseImportOrExportAssertionAndSemicolon();
3466+
attributes = parseImportOrExportAttributesAndSemicolon();
34673467
}
34683468
return this.finishNode(
3469-
new ExportNamedDeclaration(loc, declaration, specifiers, (Literal) source, assertion));
3469+
new ExportNamedDeclaration(loc, declaration, specifiers, (Literal) source, attributes));
34703470
}
34713471

34723472
/** Parses the 'from' clause of an export, not including the assertion or semicolon. */
@@ -3494,8 +3494,8 @@ protected Expression parseExportFrom(
34943494
protected ExportDeclaration parseExportAll(
34953495
SourceLocation loc, Position starLoc, Set<String> exports) {
34963496
Expression source = parseExportFrom(null, null, true);
3497-
Expression assertion = parseImportOrExportAssertionAndSemicolon();
3498-
return this.finishNode(new ExportAllDeclaration(loc, (Literal) source, assertion));
3497+
Expression attributes = parseImportOrExportAttributesAndSemicolon();
3498+
return this.finishNode(new ExportAllDeclaration(loc, (Literal) source, attributes));
34993499
}
35003500

35013501
private void checkExport(Set<String> exports, String name, Position pos) {
@@ -3560,7 +3560,7 @@ protected Statement parseImport(Position startLoc) {
35603560
return parseImportRest(loc);
35613561
}
35623562

3563-
protected Expression parseImportOrExportAssertionAndSemicolon() {
3563+
protected Expression parseImportOrExportAttributesAndSemicolon() {
35643564
Expression result = null;
35653565
if (!this.eagerlyTrySemicolon()) {
35663566
if (!this.eatContextual("assert")) {
@@ -3585,9 +3585,9 @@ protected ImportDeclaration parseImportRest(SourceLocation loc) {
35853585
if (this.type != TokenType.string) this.unexpected();
35863586
source = (Literal) this.parseExprAtom(null);
35873587
}
3588-
Expression assertion = this.parseImportOrExportAssertionAndSemicolon();
3588+
Expression attributes = this.parseImportOrExportAttributesAndSemicolon();
35893589
if (specifiers == null) return null;
3590-
return this.finishNode(new ImportDeclaration(loc, specifiers, source, assertion));
3590+
return this.finishNode(new ImportDeclaration(loc, specifiers, source, attributes));
35913591
}
35923592

35933593
// Parses a comma-separated list of module imports.

javascript/extractor/src/com/semmle/jcorn/flow/FlowParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -943,12 +943,12 @@ protected ExportDeclaration parseExportRest(SourceLocation loc, Set<String> expo
943943
// `export type { foo, bar };`
944944
List<ExportSpecifier> specifiers = this.parseExportSpecifiers(exports);
945945
this.parseExportFrom(specifiers, null, false);
946-
this.parseImportOrExportAssertionAndSemicolon();
946+
this.parseImportOrExportAttributesAndSemicolon();
947947
return null;
948948
} else if (this.eat(TokenType.star)) {
949949
if (this.eatContextual("as")) this.parseIdent(true);
950950
this.parseExportFrom(null, null, true);
951-
this.parseImportOrExportAssertionAndSemicolon();
951+
this.parseImportOrExportAttributesAndSemicolon();
952952
return null;
953953
} else {
954954
// `export type Foo = Bar;`

0 commit comments

Comments
 (0)