summaryrefslogtreecommitdiff
path: root/ext/web/02_timers.js
diff options
context:
space:
mode:
authorsnek <snek@deno.com>2024-07-09 10:07:56 -0700
committerGitHub <noreply@github.com>2024-07-09 10:07:56 -0700
commitc461f8fd2e36904b3334c9705726b713712f4a69 (patch)
tree796892fa6c0427b959e4350ed01bbe4597694779 /ext/web/02_timers.js
parent839caf6fafdf9ca1cdec6cd9cef38296be41145f (diff)
fix: do not return undefined for missing global properties (#24474)
accessing e.g. `Buffer` in `Mode::Deno` mode should throw, not return undefined. --------- Signed-off-by: snek <snek@deno.com>
Diffstat (limited to 'ext/web/02_timers.js')
-rw-r--r--ext/web/02_timers.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/web/02_timers.js b/ext/web/02_timers.js
index e30071971..559147861 100644
--- a/ext/web/02_timers.js
+++ b/ext/web/02_timers.js
@@ -35,7 +35,7 @@ function checkThis(thisArg) {
function setImmediate(callback, ...args) {
if (args.length > 0) {
const unboundCallback = callback;
- callback = () => ReflectApply(unboundCallback, window, args);
+ callback = () => ReflectApply(unboundCallback, globalThis, args);
}
return core.queueImmediate(
@@ -55,7 +55,7 @@ function setTimeout(callback, timeout = 0, ...args) {
}
if (args.length > 0) {
const unboundCallback = callback;
- callback = () => ReflectApply(unboundCallback, window, args);
+ callback = () => ReflectApply(unboundCallback, globalThis, args);
}
timeout = webidl.converters.long(timeout);
return core.queueUserTimer(
@@ -77,7 +77,7 @@ function setInterval(callback, timeout = 0, ...args) {
}
if (args.length > 0) {
const unboundCallback = callback;
- callback = () => ReflectApply(unboundCallback, window, args);
+ callback = () => ReflectApply(unboundCallback, globalThis, args);
}
timeout = webidl.converters.long(timeout);
return core.queueUserTimer(