mirror of
https://github.com/github/codeql.git
synced 2026-05-03 12:45:27 +02:00
JS: Add trap test for import assertions
This commit is contained in:
13
javascript/extractor/tests/esnext/input/import-assertion.js
Normal file
13
javascript/extractor/tests/esnext/input/import-assertion.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import "module" assert { type: "json" };
|
||||
import * as v1 from "module" assert { type: "json" };
|
||||
import { v2 } from "module" assert { type: "json" };
|
||||
import v3 from "module" assert { type: "json" };
|
||||
|
||||
export { v4 } from "module" assert { type: "json" };
|
||||
export * from "module" assert { type: "json" };
|
||||
export * as v5 from "module" assert { type: "json" };
|
||||
|
||||
const v6 = import("module", { assert: { type: "json" } });
|
||||
|
||||
import "module" // missing semicolon
|
||||
assert({type: "json"}); // function call, not import assertion
|
||||
Reference in New Issue
Block a user