Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not return undefined for missing global properties #24474

Merged
merged 5 commits into from
Jul 9, 2024

Conversation

devsnek
Copy link
Member

@devsnek devsnek commented Jul 9, 2024

accessing e.g. Buffer in Mode::Deno mode should throw, not return undefined.

@@ -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);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure why these had to be changed, i'm pretty sure this file should be deno mode.

Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - in non strict mode they'll still return undefined without throwing tho, right?

@devsnek devsnek requested a review from bartlomieju July 9, 2024 17:04
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM to me too

@devsnek devsnek merged commit c461f8f into main Jul 9, 2024
17 checks passed
@devsnek devsnek deleted the x/devsnek-patch-1 branch July 9, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants