Skip to content

Commit f87996a

Browse files
committed
Fixes microsoft#11012: Some dependencies to window from common
1 parent 4726bd3 commit f87996a

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/vs/base/common/worker/simpleWorker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,13 @@ export class SimpleWorkerClient<T> extends Disposable {
221221

222222
// Gather loader configuration
223223
let loaderConfiguration: any = null;
224-
let globalRequire = (<any>window).require;
224+
let globalRequire = (<any>self).require;
225225
if (typeof globalRequire.getConfig === 'function') {
226226
// Get the configuration from the Monaco AMD Loader
227227
loaderConfiguration = globalRequire.getConfig();
228-
} else if (typeof (<any>window).requirejs !== 'undefined') {
228+
} else if (typeof (<any>self).requirejs !== 'undefined') {
229229
// Get the configuration from requirejs
230-
loaderConfiguration = (<any>window).requirejs.s.contexts._.config;
230+
loaderConfiguration = (<any>self).requirejs.s.contexts._.config;
231231
}
232232

233233
this._lazyProxy = new TPromise((c, e, p) => {

src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class WordHighlighter {
100100

101101
// Cancel any renderDecorationsTimer
102102
if (this.renderDecorationsTimer !== -1) {
103-
window.clearTimeout(this.renderDecorationsTimer);
103+
clearTimeout(this.renderDecorationsTimer);
104104
this.renderDecorationsTimer = -1;
105105
}
106106

@@ -190,7 +190,7 @@ class WordHighlighter {
190190
if (this.workerRequestCompleted && this.renderDecorationsTimer !== -1) {
191191
// case b)
192192
// Delay the firing of renderDecorationsTimer by an extra 250 ms
193-
window.clearTimeout(this.renderDecorationsTimer);
193+
clearTimeout(this.renderDecorationsTimer);
194194
this.renderDecorationsTimer = -1;
195195
this._beginRenderDecorations();
196196
}
@@ -226,7 +226,7 @@ class WordHighlighter {
226226
this.renderDecorations();
227227
} else {
228228
// Asyncrhonous
229-
this.renderDecorationsTimer = window.setTimeout(() => {
229+
this.renderDecorationsTimer = setTimeout(() => {
230230
this.renderDecorations();
231231
}, (minimumRenderTime - currentTime));
232232
}

0 commit comments

Comments
 (0)