Merge pull request #15477 from Snuffleupagus/sandbox-destroy-timeout
Access the `setTimeout`-functionRefs correctly in `SandboxSupportBase.destroy`
This commit is contained in:
commit
ff8f850936
@ -30,7 +30,9 @@ class SandboxSupportBase {
|
|||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
this.commFun = null;
|
this.commFun = null;
|
||||||
this.timeoutIds.forEach(([_, id]) => this.win.clearTimeout(id));
|
for (const id of this.timeoutIds.values()) {
|
||||||
|
this.win.clearTimeout(id);
|
||||||
|
}
|
||||||
this.timeoutIds = null;
|
this.timeoutIds = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,9 +90,9 @@ class SandboxSupportBase {
|
|||||||
}, nMilliseconds);
|
}, nMilliseconds);
|
||||||
this.timeoutIds.set(callbackId, id);
|
this.timeoutIds.set(callbackId, id);
|
||||||
},
|
},
|
||||||
clearTimeout: id => {
|
clearTimeout: callbackId => {
|
||||||
this.win.clearTimeout(this.timeoutIds.get(id));
|
this.win.clearTimeout(this.timeoutIds.get(callbackId));
|
||||||
this.timeoutIds.delete(id);
|
this.timeoutIds.delete(callbackId);
|
||||||
},
|
},
|
||||||
setInterval: (callbackId, nMilliseconds) => {
|
setInterval: (callbackId, nMilliseconds) => {
|
||||||
if (
|
if (
|
||||||
@ -107,9 +109,9 @@ class SandboxSupportBase {
|
|||||||
}, nMilliseconds);
|
}, nMilliseconds);
|
||||||
this.timeoutIds.set(callbackId, id);
|
this.timeoutIds.set(callbackId, id);
|
||||||
},
|
},
|
||||||
clearInterval: id => {
|
clearInterval: callbackId => {
|
||||||
this.win.clearInterval(this.timeoutIds.get(id));
|
this.win.clearInterval(this.timeoutIds.get(callbackId));
|
||||||
this.timeoutIds.delete(id);
|
this.timeoutIds.delete(callbackId);
|
||||||
},
|
},
|
||||||
alert: cMsg => {
|
alert: cMsg => {
|
||||||
if (typeof cMsg !== "string") {
|
if (typeof cMsg !== "string") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user