diff --git a/src/interfaces.d.ts b/src/interfaces.d.ts index 72c27c3..3b12811 100644 --- a/src/interfaces.d.ts +++ b/src/interfaces.d.ts @@ -236,4 +236,4 @@ declare interface NodeRequire { undef(moduleId: string, recursive?: boolean): void; } -declare const arguments: IArguments; +declare var arguments: IArguments; diff --git a/src/loader.ts b/src/loader.ts index 8a38347..b0e602e 100644 --- a/src/loader.ts +++ b/src/loader.ts @@ -3,9 +3,8 @@ import ModuleShim = DojoLoader.ModuleShim; import Module = DojoLoader.Module; import Package = DojoLoader.Package; -declare const load: (module: string) => any; -declare const Packages: {} | undefined; -declare const importScripts: ((url: string) => void); +// Nashorn global +declare var Packages: { [key: string]: any; } | undefined; (function (args?: string[]): void { let globalObject: any = (function (): any { @@ -24,6 +23,12 @@ declare const importScripts: ((url: string) => void); return {}; })(); + // Nashorn global + const load: (module: string) => any = globalObject.load; + + // webworker global + const importScripts: ((url: string) => void) = globalObject.importScripts; + const EXECUTING = 'executing'; const ABORT_EXECUTION: Object = {}; //