Skip to content

Commit fca06cb

Browse files
committed
test(runtime): pin what import() settles with per importer and specifier shape
The import() resolution table records the outcome of 83 specifiers from a file module, a direct eval inside one, a CommonJS script, new Function, an indirect eval and an HTTP module, plus identity, concurrency and JSON attribute specs. Rows hold Android's current outcomes, including a blob URL with a fragment rejecting with "Blob not found". The import-map lookup group compares a static import with an import() issued from a module in the same directory, for exact, prefix, http(s) prefix and scoped entries, and for relative and ~/ specifiers carrying a query or fragment.
1 parent d2543e9 commit fca06cb

22 files changed

Lines changed: 430 additions & 12 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
globalThis.__importPinConcurrentEvaluations = (globalThis.__importPinConcurrentEvaluations || 0) + 1;
2+
export const name = "concurrent";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "name": "json" }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const name = "dir-index";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
exports.load = function (spec) {
2+
return import(spec);
3+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export function load(spec, options) {
2+
return options === undefined ? import(spec) : import(spec, options);
3+
}
4+
5+
export function evalLoad(spec) {
6+
return eval("import(spec)");
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const name = "leaf";
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import { missingExport } from "./leaf.mjs";
2+
export const name = "link-export" + missingExport;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import "./missing-dependency.mjs";
2+
export const name = "link-missing";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const name = ;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const name = "throws";
2+
throw new TypeError("import-pin evaluation error");

0 commit comments

Comments
 (0)