Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Nov 19, 2025

This fallback to windows.event goes all the way back to the original implementation in 2014: 96895e6.

According to AI the reason for this code was likely IE support:

"""
This common JavaScript pattern used in legacy code to ensure cross-browser compatibility for accessing the event object. This was necessary because older versions of Microsoft Internet Explorer (IE) handled events differently than the standards-compliant browsers.
"""

@sbc100 sbc100 requested review from dschuff and juj November 19, 2025 01:59
Browser.calculateMouseEvent(event);

// cross-browser wheel delta
var e = window.event || event; // old IE support
Copy link
Member

Choose a reason for hiding this comment

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

Also it says `// old IE support' so the reasoning seems pretty sound.

This fallback to `windows.event` goes all the way back to the original
implementation in 2014: 96895e6.

According to AI the reason for this code was likely IE support:

"""
This common JavaScript pattern used in legacy code to ensure
cross-browser compatibility for accessing the event object. This was
necessary because older versions of Microsoft Internet Explorer (IE)
handled events differently than the standards-compliant browsers.
"""
@sbc100 sbc100 force-pushed the remove_global_event_usage branch from 4049a0e to 62e77d6 Compare November 19, 2025 20:49
@sbc100 sbc100 merged commit 95d2bf9 into emscripten-core:main Nov 20, 2025
32 of 34 checks passed
@sbc100 sbc100 deleted the remove_global_event_usage branch November 20, 2025 00:25
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.

2 participants