File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ import path from 'node:path';
1717
1818import { loadDhModules } from ' @deephaven/jsapi-nodejs' ;
1919
20+ // Polyfills needed if consuming DH as `ESM` module
21+ globalThis .self = globalThis ;
22+ globalThis .window = globalThis ;
23+
2024const tmpDir = path .join (__dirname , ' tmp' );
2125
2226// Download jsapi from a Deephaven server
Original file line number Diff line number Diff line change @@ -100,17 +100,6 @@ export async function loadDhModules({
100100 LoadModuleOptions ,
101101 'serverUrl' | 'storageDir' | 'targetModuleType'
102102> ) : Promise < typeof DhType > {
103- if ( targetModuleType === 'esm' ) {
104- // These will not be needed if we ever update the JSAPI to not rely on
105- // `window` and `self`.
106- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
107- // @ts -ignore
108- globalThis . self = globalThis ;
109- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
110- // @ts -ignore
111- globalThis . window = globalThis ;
112- }
113-
114103 const coreModule = await loadModules <
115104 typeof DhType & { default ?: typeof DhType }
116105 > ( {
You can’t perform that action at this time.
0 commit comments