forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix synth trace handling of Date constructor
Summary: The current implementation of the `Date` constructor in synth traces invokes `Date` by obtaining it from the global object. However, this can break valid JS code, since the `Date` property may have been changed by the user. We should instead be invoking the real `Date` constructor that was saved. See the added test for an example of how the current setup might break. To fix this, we can change the `nativeDateCtor` function to act like `Date.now()`. The result of that call can then be used to deterministically reconstruct the `Date` object. Original Author: neildhar Original Reviewed By: fbmal7 Original Revision: D38897029 Original Git: 36ed60d Reviewed By: neildhar Differential Revision: D39736207 fbshipit-source-id: 6d3931ad665dcceabc1e07a98a10823b5564a212
- Loading branch information
Showing
2 changed files
with
23 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters