@@ -91,14 +91,27 @@ class ImportDeclaration extends Stmt, Import, @import_declaration {
9191 override PathExpr getImportedPath ( ) { result = this .getChildExpr ( - 1 ) }
9292
9393 /**
94- * Gets the object literal passed as part of the `assert` clause in this import declaration.
94+ * Gets the object literal passed as part of the `with` (or ` assert`) clause in this import declaration.
9595 *
9696 * For example, this gets the `{ type: "json" }` object literal in the following:
9797 * ```js
98+ * import foo from "foo" with { type: "json" };
9899 * import foo from "foo" assert { type: "json" };
99100 * ```
100101 */
101- ObjectExpr getImportAssertion ( ) { result = this .getChildExpr ( - 10 ) }
102+ ObjectExpr getImportAttributes ( ) { result = this .getChildExpr ( - 10 ) }
103+
104+ /**
105+ * DEPRECATED: use `getImportAttributes` instead.
106+ * Gets the object literal passed as part of the `with` (or `assert`) clause in this import declaration.
107+ *
108+ * For example, this gets the `{ type: "json" }` object literal in the following:
109+ * ```js
110+ * import foo from "foo" with { type: "json" };
111+ * import foo from "foo" assert { type: "json" };
112+ * ```
113+ */
114+ deprecated ObjectExpr getImportAssertion ( ) { result = this .getImportAttributes ( ) }
102115
103116 /** Gets the `i`th import specifier of this import declaration. */
104117 ImportSpecifier getSpecifier ( int i ) { result = this .getChildExpr ( i ) }
@@ -322,17 +335,33 @@ abstract class ExportDeclaration extends Stmt, @export_declaration {
322335 override string getAPrimaryQlClass ( ) { result = "ExportDeclaration" }
323336
324337 /**
325- * Gets the object literal passed as part of the `assert` clause, if this is
338+ * Gets the object literal passed as part of the `with` (or `assert`) clause, if this is
339+ * a re-export declaration.
340+ *
341+ * For example, this gets the `{ type: "json" }` expression in each of the following:
342+ * ```js
343+ * export { x } from 'foo' with { type: "json" };
344+ * export * from 'foo' with { type: "json" };
345+ * export * as x from 'foo' with { type: "json" };
346+ * export * from 'foo' assert { type: "json" };
347+ * ```
348+ */
349+ ObjectExpr getImportAttributes ( ) { result = this .getChildExpr ( - 10 ) }
350+
351+ /**
352+ * DEPRECATED: use `getImportAttributes` instead.
353+ * Gets the object literal passed as part of the `with` (or `assert`) clause, if this is
326354 * a re-export declaration.
327355 *
328356 * For example, this gets the `{ type: "json" }` expression in each of the following:
329357 * ```js
330- * export { x } from 'foo' assert { type: "json" };
358+ * export { x } from 'foo' with { type: "json" };
359+ * export * from 'foo' with { type: "json" };
360+ * export * as x from 'foo' with { type: "json" };
331361 * export * from 'foo' assert { type: "json" };
332- * export * as x from 'foo' assert { type: "json" };
333362 * ```
334363 */
335- ObjectExpr getImportAssertion ( ) { result = this .getChildExpr ( - 10 ) }
364+ deprecated ObjectExpr getImportAssertion ( ) { result = this .getImportAttributes ( ) }
336365}
337366
338367/**
0 commit comments