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

[Merged by Bors] - Add hooks to get the current time and timezone #2824

Closed
wants to merge 3 commits into from

Conversation

jedel1043
Copy link
Member

This Pull Request changes the following:

  • Adds two new hooks to HostHooks to access the current UTC time and the current timezone offset.
  • Replaces usages of Local with the host hook.
  • Replaces usages of Utc::now and Local::now with the hooks.

cc @lastmjs

@jedel1043 jedel1043 added builtins PRs and Issues related to builtins/intrinsics API labels Apr 15, 2023
@jedel1043 jedel1043 added this to the v0.17.0 milestone Apr 15, 2023
@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 94,781 94,781 0
Passed 71,628 71,630 +2
Ignored 17,824 17,824 0
Failed 5,329 5,327 -2
Panics 0 0 0
Conformance 75.57% 75.57% +0.00%
Fixed tests (2):
test/annexB/built-ins/Date/prototype/toGMTString/value.js [strict mode] (previously Failed)
test/annexB/built-ins/Date/prototype/toGMTString/value.js (previously Failed)

@codecov
Copy link

codecov bot commented Apr 15, 2023

Codecov Report

Merging #2824 (53bd4f8) into main (236012d) will increase coverage by 0.06%.
The diff coverage is 89.58%.

@@            Coverage Diff             @@
##             main    #2824      +/-   ##
==========================================
+ Coverage   51.32%   51.38%   +0.06%     
==========================================
  Files         417      417              
  Lines       41356    41330      -26     
==========================================
+ Hits        21224    21238      +14     
+ Misses      20132    20092      -40     
Impacted Files Coverage Δ
boa_engine/src/object/builtins/jsdate.rs 0.00% <0.00%> (ø)
boa_engine/src/builtins/date/mod.rs 91.69% <91.86%> (+0.27%) ⬆️
boa_engine/src/builtins/date/utils.rs 98.79% <100.00%> (ø)
boa_engine/src/context/hooks.rs 75.00% <100.00%> (+4.16%) ⬆️

... and 12 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

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

It looks great to me :) Let's wait for @lastmjs to give some feedback on wether this is good enough for him to use the upstream Boa.

boa_engine/src/context/hooks.rs Outdated Show resolved Hide resolved
jedel1043 and others added 2 commits April 15, 2023 13:34
Co-authored-by: Iban Eguia Moraza <razican@protonmail.ch>
@lastmjs
Copy link
Contributor

lastmjs commented Apr 15, 2023

I will try this out now and let you know

@lastmjs
Copy link
Contributor

lastmjs commented Apr 15, 2023

I can confirm this works, all of our tests have passed.

We're now on upstream Boa with this branch, and will be on main once this is merged :)

Thanks so much, this is just great.

Copy link
Member

@HalidOdat HalidOdat left a comment

Choose a reason for hiding this comment

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

Looks good to me! Lets get this merged! :)

@HalidOdat
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Apr 15, 2023
This Pull Request changes the following:

- Adds two new hooks to `HostHooks` to access the current UTC time and the current timezone offset.
- Replaces usages of `Local` with the host hook.
- Replaces usages of `Utc::now` and `Local::now` with the hooks.

cc @lastmjs
@bors
Copy link

bors bot commented Apr 15, 2023

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Add hooks to get the current time and timezone [Merged by Bors] - Add hooks to get the current time and timezone Apr 15, 2023
@bors bors bot closed this Apr 15, 2023
@bors bors bot deleted the datetime-hooks branch April 15, 2023 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API builtins PRs and Issues related to builtins/intrinsics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants