mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Rename 'getImportAssertion()' to 'getImportAttributes()' in QL library
This commit is contained in:
@@ -91,14 +91,27 @@ class ImportDeclaration extends Stmt, Import, @import_declaration {
|
||||
override PathExpr getImportedPath() { result = this.getChildExpr(-1) }
|
||||
|
||||
/**
|
||||
* Gets the object literal passed as part of the `assert` clause in this import declaration.
|
||||
* Gets the object literal passed as part of the `with` (or `assert`) clause in this import declaration.
|
||||
*
|
||||
* For example, this gets the `{ type: "json" }` object literal in the following:
|
||||
* ```js
|
||||
* import foo from "foo" with { type: "json" };
|
||||
* import foo from "foo" assert { type: "json" };
|
||||
* ```
|
||||
*/
|
||||
ObjectExpr getImportAssertion() { result = this.getChildExpr(-10) }
|
||||
ObjectExpr getImportAttributes() { result = this.getChildExpr(-10) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: use `getImportAttributes` instead.
|
||||
* Gets the object literal passed as part of the `with` (or `assert`) clause in this import declaration.
|
||||
*
|
||||
* For example, this gets the `{ type: "json" }` object literal in the following:
|
||||
* ```js
|
||||
* import foo from "foo" with { type: "json" };
|
||||
* import foo from "foo" assert { type: "json" };
|
||||
* ```
|
||||
*/
|
||||
deprecated ObjectExpr getImportAssertion() { result = this.getImportAttributes() }
|
||||
|
||||
/** Gets the `i`th import specifier of this import declaration. */
|
||||
ImportSpecifier getSpecifier(int i) { result = this.getChildExpr(i) }
|
||||
@@ -322,17 +335,33 @@ abstract class ExportDeclaration extends Stmt, @export_declaration {
|
||||
override string getAPrimaryQlClass() { result = "ExportDeclaration" }
|
||||
|
||||
/**
|
||||
* Gets the object literal passed as part of the `assert` clause, if this is
|
||||
* Gets the object literal passed as part of the `with` (or `assert`) clause, if this is
|
||||
* a re-export declaration.
|
||||
*
|
||||
* For example, this gets the `{ type: "json" }` expression in each of the following:
|
||||
* ```js
|
||||
* export { x } from 'foo' assert { type: "json" };
|
||||
* export { x } from 'foo' with { type: "json" };
|
||||
* export * from 'foo' with { type: "json" };
|
||||
* export * as x from 'foo' with { type: "json" };
|
||||
* export * from 'foo' assert { type: "json" };
|
||||
* export * as x from 'foo' assert { type: "json" };
|
||||
* ```
|
||||
*/
|
||||
ObjectExpr getImportAssertion() { result = this.getChildExpr(-10) }
|
||||
ObjectExpr getImportAttributes() { result = this.getChildExpr(-10) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: use `getImportAttributes` instead.
|
||||
* Gets the object literal passed as part of the `with` (or `assert`) clause, if this is
|
||||
* a re-export declaration.
|
||||
*
|
||||
* For example, this gets the `{ type: "json" }` expression in each of the following:
|
||||
* ```js
|
||||
* export { x } from 'foo' with { type: "json" };
|
||||
* export * from 'foo' with { type: "json" };
|
||||
* export * as x from 'foo' with { type: "json" };
|
||||
* export * from 'foo' assert { type: "json" };
|
||||
* ```
|
||||
*/
|
||||
deprecated ObjectExpr getImportAssertion() { result = this.getImportAttributes() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2807,7 +2807,7 @@ class FunctionBindExpr extends @bind_expr, Expr {
|
||||
*
|
||||
* ```
|
||||
* import("fs")
|
||||
* import("foo", { assert: { type: "json" }})
|
||||
* import("foo", { with: { type: "json" }})
|
||||
* ```
|
||||
*/
|
||||
class DynamicImportExpr extends @dynamic_import, Expr, Import {
|
||||
@@ -2823,9 +2823,9 @@ class DynamicImportExpr extends @dynamic_import, Expr, Import {
|
||||
/**
|
||||
* Gets the second "argument" to the import expression, that is, the `Y` in `import(X, Y)`.
|
||||
*
|
||||
* For example, gets the `{ assert: { type: "json" }}` expression in the following:
|
||||
* For example, gets the `{ with: { type: "json" }}` expression in the following:
|
||||
* ```js
|
||||
* import('foo', { assert: { type: "json" }})
|
||||
* import('foo', { with: { type: "json" }})
|
||||
* ```
|
||||
*/
|
||||
Expr getImportAttributes() { result = this.getChildExpr(1) }
|
||||
|
||||
Reference in New Issue
Block a user