diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/node/global.rs | 4 | ||||
-rw-r--r-- | ext/web/02_timers.js | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/ext/node/global.rs b/ext/node/global.rs index e01fca95e..2367814f9 100644 --- a/ext/node/global.rs +++ b/ext/node/global.rs @@ -305,6 +305,10 @@ pub fn getter<'s>( let reflect_get = v8::Local::new(scope, reflect_get); let inner = v8::Local::new(scope, inner); + if !inner.has_own_property(scope, key).unwrap_or(false) { + return v8::Intercepted::No; + } + let undefined = v8::undefined(scope); let Some(value) = reflect_get.call( scope, 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( |