diff options
Diffstat (limited to 'integration')
4 files changed, 35 insertions, 0 deletions
diff --git a/integration/scripts/browser.js b/integration/scripts/browser.js index 7aa027d77..6ec075b11 100644 --- a/integration/scripts/browser.js +++ b/integration/scripts/browser.js @@ -90,6 +90,7 @@ async function main() { "/bundled-entry-point.js", "/export.js", "/type-only-imports.ts", + "/global-is-remapped-to-globalThis.js", ]; for (let test of tests) { diff --git a/integration/snapshots-no-hmr/global-is-remapped-to-globalThis.js b/integration/snapshots-no-hmr/global-is-remapped-to-globalThis.js new file mode 100644 index 000000000..9000d14b0 --- /dev/null +++ b/integration/snapshots-no-hmr/global-is-remapped-to-globalThis.js @@ -0,0 +1,4 @@ +export function test() { + console.assert(globalThis === globalThis); + return testDone(import.meta.url); +} diff --git a/integration/snapshots/global-is-remapped-to-globalThis.js b/integration/snapshots/global-is-remapped-to-globalThis.js new file mode 100644 index 000000000..dace8fa7a --- /dev/null +++ b/integration/snapshots/global-is-remapped-to-globalThis.js @@ -0,0 +1,26 @@ +import { +__HMRModule as HMR +} from "http://localhost:8080/__runtime.js"; +import { +__HMRClient as Bun +} from "http://localhost:8080/__runtime.js"; +Bun.activate(true); + +var hmr = new HMR(713665787, "global-is-remapped-to-globalThis.js"), exports = hmr.exports; +(hmr._load = function() { + function test() { + console.assert(globalThis === globalThis); + return testDone(import.meta.url); + } + hmr.exportAll({ + test: () => test + }); +})(); +var $$hmr_test = hmr.exports.test; +hmr._update = function(exports) { + $$hmr_test = exports.test; +}; + +export { + $$hmr_test as test +}; diff --git a/integration/snippets/global-is-remapped-to-globalThis.js b/integration/snippets/global-is-remapped-to-globalThis.js new file mode 100644 index 000000000..06b887925 --- /dev/null +++ b/integration/snippets/global-is-remapped-to-globalThis.js @@ -0,0 +1,4 @@ +export function test() { + console.assert(global === globalThis); + return testDone(import.meta.url); +} |