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

Correctly set global #1862

Closed
wants to merge 29 commits into from

Conversation

mrousavy
Copy link
Contributor

@mrousavy mrousavy commented Mar 23, 2021

Description

This is a follow-up PR of #1861. Until now, global in Worklets was set to a dummy object which just contained __reanimatedWorkletInit. This PR changes this, so that all other global properties that are being set in the RuntimeDecorator::decorateRuntime func are also in the global object.

This means, global._LABEL returns the correct label, global._WORKLET returns true, etc. and Object.keys(global) returns all the correct keys.

Changes

  • Assign global to the hidden global object so you can correctly use global. code. (e.g. global._log, global._WORKLET, global._LABEL, ...)
  • Add global._chronoNow, a function that returns chrono's time_since_epoch (polyfill for performance.now())

@piaskowyk piaskowyk self-requested a review March 30, 2021 14:00
@tomekzaw
Copy link
Member

Closing this PR since it looks like all the changes from PR have already been covered with these:

Thanks!

@tomekzaw tomekzaw closed this Apr 11, 2022
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