fune/dom/workers/test/WorkerDebugger.initialize_es_worker.js
Alexandre Poirot 625273f385 Bug 1816933 - [devtools] Force loading the debugger worker script as "classic". r=yulia,devtools-reviewers,bomsy,nchevobbe
This prevents loading the debugger script the same way the worker is loaded.
So prevent loading it as ES Module when the worker is using ES Module.

Differential Revision: https://phabricator.services.mozilla.com/D173257
2023-03-28 12:32:58 +00:00

10 lines
288 B
JavaScript

"use strict";
// The following check is one possible way to identify
// if this script is loaded as a ES Module or the classic way.
const isLoadedAsEsModule = this != globalThis;
// Here we expect the worker to be loaded a ES Module
if (isLoadedAsEsModule) {
postMessage("worker");
}