Skip to content

Commit d1783ba

Browse files
committed
📷
1 parent 7519f36 commit d1783ba

2 files changed

Lines changed: 80 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import {
2+
__require as require
3+
} from "http://localhost:8080/__runtime.js";
4+
import {
5+
__HMRModule as HMR
6+
} from "http://localhost:8080/__runtime.js";
7+
import {
8+
__HMRClient as Bun
9+
} from "http://localhost:8080/__runtime.js";
10+
Bun.activate(false);
11+
12+
var hmr = new HMR(2398506918, "caught-require.js"), exports = hmr.exports;
13+
await (hmr._load = async function() {
14+
try {
15+
require((() => { throw (new Error(`Cannot require module '"this-package-should-not-exist"'`)); } )());
16+
} catch (exception) {
17+
}
18+
try {
19+
await import("this-package-should-not-exist");
20+
} catch (exception) {
21+
}
22+
import("this-package-should-not-exist").then(() => {
23+
}, () => {
24+
});
25+
async function test() {
26+
try {
27+
require((() => { throw (new Error(`Cannot require module '"this-package-should-not-exist"'`)); } )());
28+
} catch (exception) {
29+
}
30+
try {
31+
await import("this-package-should-not-exist");
32+
} catch (exception) {
33+
}
34+
import("this-package-should-not-exist").then(() => {
35+
}, () => {
36+
});
37+
return testDone(import.meta.url);
38+
}
39+
hmr.exportAll({
40+
test: () => test
41+
});
42+
})();
43+
var $$hmr_test = hmr.exports.test;
44+
hmr._update = function(exports) {
45+
$$hmr_test = exports.test;
46+
};
47+
48+
export {
49+
$$hmr_test as test
50+
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import {
2+
__require as require
3+
} from "http://localhost:8080/__runtime.js";
4+
try {
5+
require((() => { throw (new Error(`Cannot require module '"this-package-should-not-exist"'`)); } )());
6+
7+
} catch (exception) {
8+
}
9+
10+
try {
11+
await import("this-package-should-not-exist");
12+
} catch (exception) {
13+
}
14+
import("this-package-should-not-exist").then(() => {
15+
}, () => {
16+
});
17+
export async function test() {
18+
try {
19+
require((() => { throw (new Error(`Cannot require module '"this-package-should-not-exist"'`)); } )());
20+
} catch (exception) {
21+
}
22+
try {
23+
await import("this-package-should-not-exist");
24+
} catch (exception) {
25+
}
26+
import("this-package-should-not-exist").then(() => {
27+
}, () => {
28+
});
29+
return testDone(import.meta.url);
30+
}

0 commit comments

Comments
 (0)