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

RuntimeDecorator: Correctly set global #1833

Closed

Conversation

mrousavy
Copy link
Contributor

@mrousavy mrousavy commented Mar 16, 2021

Description

This is a follow-up PR of #1790. 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.

I have decided to make this a follow-up PR, because I am not sure if this has side-effects. I haven't noticed any, but if anyone else does, please let me know. cc @Szymon20000 @karol-bisztyga @piaskowyk

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())

`CADisplayLink::targetTimestamp` is only available on iOS 10 or newer. So it wouldn't even build.
@mrousavy
Copy link
Contributor Author

Closed in favor of #1862.

@mrousavy mrousavy closed this Mar 23, 2021
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.

None yet

1 participant