We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bdbd9e3 commit 77ba623Copy full SHA for 77ba623
html/js/sandbox.js
@@ -194,12 +194,20 @@
194
195
win.__setTimeout = win.setTimeout
196
win.__setInterval = win.setInterval
197
- win.setTimeout = (code, time) => {
+ win.setTimeout = (code, time, ...args) => {
198
+ if (args.length && typeof code != "string") {
199
+ let f = code
200
+ code = () => f(...args)
201
+ }
202
let val = win.__setTimeout(() => this.run(code), time)
203
this.timeouts.push(val)
204
return val
205
}
- win.setInterval = (code, time) => {
206
+ win.setInterval = (code, time, ...args) => {
207
208
209
210
211
let val = win.__setInterval(() => this.run(code), time)
212
this.intervals.push(val)
213
0 commit comments