Skip to content

Avoid reverse dependencies in JS library code handling time. NFC - #16118

Merged
sbc100 merged 1 commit into
mainfrom
cleanup_time_globals
Jan 27, 2022
Merged

sbc100 merged 1 commit into
mainfrom
cleanup_time_globals

Conversation

@sbc100

@sbc100 sbc100 commented Jan 26, 2022 •

Copy link
Copy Markdown
Collaborator

Specifically this change removes _get_daylight, _get_daylight
and _get_tzname which are native symbols that were used by
tzset which has a lot of different call sites.

This made reverse dependencies on these symbols fairly common
and easy to miss. See #15958 for a recent example.

This change removes these functions completely in favor or just
passing these addresses in as arguments.

Fixes: #15958

@sbc100
sbc100 force-pushed the cleanup_time_globals branch from 81d915d to d64b31a Compare January 26, 2022 22:17
@sbc100
sbc100 requested a review from kripken January 26, 2022 22:17
Specifically this change removes `_get_daylight`, `_get_daylight`
and `_get_tzname` which are native symbols that were used by
`tzset` which has a lot of different call sites.

This made reverse dependencies on these symbols fairly common
and easy to miss.  See #15958 for a recent example.

This change removes these functions completely in favor or just
passing these addresses in as arguments.

Fixes: #15958
@sbc100
sbc100 force-pushed the cleanup_time_globals branch from d64b31a to 27da623 Compare January 26, 2022 22:18

@kripken kripken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

I really think this general pattern is the way to go: X.c in C, and it calls X_js which does the JS-specific things. And we can pass the JS the things it needs, to avoid reverse deps.

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.

Linking errors after switched to new emsdk...

2 participants