Skip to content

Remove setTimeout polyfill from JS shell code. NFC#26727

Merged
sbc100 merged 1 commit intoemscripten-core:mainfrom
sbc100:setTimeout_polyfill
Apr 21, 2026
Merged

Remove setTimeout polyfill from JS shell code. NFC#26727
sbc100 merged 1 commit intoemscripten-core:mainfrom
sbc100:setTimeout_polyfill

Conversation

@sbc100
Copy link
Copy Markdown
Collaborator

@sbc100 sbc100 commented Apr 19, 2026

All the JS shells, including spidermonkey, seem to support setTimeout natively these days.

@sbc100 sbc100 requested review from dschuff and kripken April 19, 2026 00:11
All the JS shells, including spidermonkey, seem to support setTimeout
natively these days.
@sbc100 sbc100 force-pushed the setTimeout_polyfill branch from d417256 to 8306f98 Compare April 19, 2026 00:14
Comment thread src/shell.js

globalThis.clearTimeout ??= (id) => {};

// spidermonkey lacks setTimeout but we use it above in readAsync.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If setTimeout removed, then I think clearTimeout also need removed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Actually not. While all the of the JS shells support setTimeout, none of them support clearTimeout

@sbc100 sbc100 requested a review from brendandahl April 20, 2026 23:04
@sbc100 sbc100 enabled auto-merge (squash) April 21, 2026 00:47
@sbc100 sbc100 merged commit 50cdbb2 into emscripten-core:main Apr 21, 2026
29 checks passed
@sbc100 sbc100 deleted the setTimeout_polyfill branch April 21, 2026 14:39
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