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

Date Implementation #596

Merged
merged 33 commits into from
Aug 7, 2020
Merged

Date Implementation #596

merged 33 commits into from
Aug 7, 2020

Conversation

jcdickinson
Copy link
Contributor

This Pull Request fixes/closes #252.

It changes the following:

  • Add [Global] internal slot that contains nothing. This is used to differentiate between constructor calls and function calls in the Date constructor.
  • Add Date according to spec.

Copy link
Contributor Author

@jcdickinson jcdickinson left a comment

Choose a reason for hiding this comment

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

Please review these changes (first commit), the Date constructor can be called as a regular function and behaves differently. In order to do that, I need to determine if this is global (the spec calls this "thisTarget is undefined", but there is no thisTarget in Boa).

@codecov
Copy link

codecov bot commented Jul 27, 2020

Codecov Report

Merging #596 into master will increase coverage by 0.84%.
The diff coverage is 83.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #596      +/-   ##
==========================================
+ Coverage   71.67%   72.51%   +0.84%     
==========================================
  Files         177      179       +2     
  Lines       11647    12553     +906     
==========================================
+ Hits         8348     9103     +755     
- Misses       3299     3450     +151     
Impacted Files Coverage Δ
boa/src/builtins/mod.rs 22.58% <0.00%> (-0.76%) ⬇️
boa/src/builtins/object/mod.rs 38.81% <0.00%> (-0.36%) ⬇️
boa/src/builtins/value/val_type.rs 24.00% <0.00%> (-1.00%) ⬇️
boa/src/builtins/value/mod.rs 65.49% <50.00%> (-0.44%) ⬇️
boa/src/builtins/date/mod.rs 69.75% <69.75%> (ø)
boa/src/builtins/value/operations.rs 31.36% <80.00%> (+0.48%) ⬆️
boa/src/builtins/date/tests.rs 99.30% <99.30%> (ø)
boa/src/builtins/object/tests.rs 100.00% <100.00%> (ø)
boa/src/realm.rs 72.22% <100.00%> (+1.63%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8036a49...84489dc. Read the comment docs.

@Lan2u Lan2u added the enhancement New feature or request label Jul 28, 2020
@HalidOdat HalidOdat added the builtins PRs and Issues related to builtins/intrinsics label Aug 3, 2020
Jonathan Dickinson added 3 commits August 2, 2020 22:28
Correctly handle `toJSON`
Correctly handle `valueOf` in neg
@jcdickinson
Copy link
Contributor Author

Marking this as ready for review. This will likely need to be revisited when test262 works.

@jcdickinson jcdickinson marked this pull request as ready for review August 3, 2020 05:41
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.

Looking good, check my comments :)

boa/src/builtins/date/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/date/mod.rs Show resolved Hide resolved
boa/src/builtins/date/mod.rs Outdated Show resolved Hide resolved
@Razican Razican merged commit 8fd5533 into boa-dev:master Aug 7, 2020
@HalidOdat HalidOdat added this to the v0.10.0 milestone Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins PRs and Issues related to builtins/intrinsics enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date() is needed https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
4 participants