提交 f87996af 编写于 作者: A Alex Dima

Fixes #11012: Some dependencies to window from common

上级 4726bd3d
...@@ -221,13 +221,13 @@ export class SimpleWorkerClient<T> extends Disposable { ...@@ -221,13 +221,13 @@ export class SimpleWorkerClient<T> extends Disposable {
// Gather loader configuration // Gather loader configuration
let loaderConfiguration: any = null; let loaderConfiguration: any = null;
let globalRequire = (<any>window).require; let globalRequire = (<any>self).require;
if (typeof globalRequire.getConfig === 'function') { if (typeof globalRequire.getConfig === 'function') {
// Get the configuration from the Monaco AMD Loader // Get the configuration from the Monaco AMD Loader
loaderConfiguration = globalRequire.getConfig(); loaderConfiguration = globalRequire.getConfig();
} else if (typeof (<any>window).requirejs !== 'undefined') { } else if (typeof (<any>self).requirejs !== 'undefined') {
// Get the configuration from requirejs // Get the configuration from requirejs
loaderConfiguration = (<any>window).requirejs.s.contexts._.config; loaderConfiguration = (<any>self).requirejs.s.contexts._.config;
} }
this._lazyProxy = new TPromise((c, e, p) => { this._lazyProxy = new TPromise((c, e, p) => {
......
...@@ -100,7 +100,7 @@ class WordHighlighter { ...@@ -100,7 +100,7 @@ class WordHighlighter {
// Cancel any renderDecorationsTimer // Cancel any renderDecorationsTimer
if (this.renderDecorationsTimer !== -1) { if (this.renderDecorationsTimer !== -1) {
window.clearTimeout(this.renderDecorationsTimer); clearTimeout(this.renderDecorationsTimer);
this.renderDecorationsTimer = -1; this.renderDecorationsTimer = -1;
} }
...@@ -190,7 +190,7 @@ class WordHighlighter { ...@@ -190,7 +190,7 @@ class WordHighlighter {
if (this.workerRequestCompleted && this.renderDecorationsTimer !== -1) { if (this.workerRequestCompleted && this.renderDecorationsTimer !== -1) {
// case b) // case b)
// Delay the firing of renderDecorationsTimer by an extra 250 ms // Delay the firing of renderDecorationsTimer by an extra 250 ms
window.clearTimeout(this.renderDecorationsTimer); clearTimeout(this.renderDecorationsTimer);
this.renderDecorationsTimer = -1; this.renderDecorationsTimer = -1;
this._beginRenderDecorations(); this._beginRenderDecorations();
} }
...@@ -226,7 +226,7 @@ class WordHighlighter { ...@@ -226,7 +226,7 @@ class WordHighlighter {
this.renderDecorations(); this.renderDecorations();
} else { } else {
// Asyncrhonous // Asyncrhonous
this.renderDecorationsTimer = window.setTimeout(() => { this.renderDecorationsTimer = setTimeout(() => {
this.renderDecorations(); this.renderDecorations();
}, (minimumRenderTime - currentTime)); }, (minimumRenderTime - currentTime));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册