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

Implement Array.prototype.reduce #555

Merged
merged 4 commits into from
Jul 15, 2020

Conversation

benjaminflin
Copy link
Contributor

I implemented Array.prototype.reduce according to the spec. Let me know if I missed anything as this is my first time contributing.

@codecov
Copy link

codecov bot commented Jul 8, 2020

Codecov Report

Merging #555 into master will increase coverage by 1.65%.
The diff coverage is 89.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #555      +/-   ##
==========================================
+ Coverage   68.19%   69.84%   +1.65%     
==========================================
  Files         172      172              
  Lines       10573    10796     +223     
==========================================
+ Hits         7210     7541     +331     
+ Misses       3363     3255     -108     
Impacted Files Coverage Δ
boa/src/builtins/array/mod.rs 80.97% <83.78%> (+0.16%) ⬆️
boa/src/builtins/array/tests.rs 100.00% <100.00%> (ø)
boa/src/exec/tests.rs 100.00% <0.00%> (ø)
boa/src/builtins/math/tests.rs 100.00% <0.00%> (ø)
boa/src/builtins/bigint/tests.rs 100.00% <0.00%> (ø)
boa/src/builtins/number/tests.rs 100.00% <0.00%> (ø)
boa/src/builtins/object/tests.rs 100.00% <0.00%> (ø)
boa/src/syntax/lexer/mod.rs 56.09% <0.00%> (+0.24%) ⬆️
boa/src/builtins/value/operations.rs 30.87% <0.00%> (+0.46%) ⬆️
boa/src/builtins/object/internal_methods.rs 30.36% <0.00%> (+0.52%) ⬆️
... and 41 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 a933ae8...e1cd08e. Read the comment docs.

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! check my comments on how to improve it :)

boa/src/builtins/array/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/array/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/array/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/array/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/array/mod.rs Outdated Show resolved Hide resolved
@HalidOdat HalidOdat added builtins PRs and Issues related to builtins/intrinsics enhancement New feature or request labels Jul 9, 2020
boa/src/builtins/array/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/array/mod.rs Outdated Show resolved Hide resolved
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.

Perfect! Thanks for the contribution @benjaminflin :)

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.

Looks very good, thanks! Could you check the second TypeError message? Also, I would prefer if we added some tests for the error cases too.

boa/src/builtins/array/mod.rs Outdated Show resolved Hide resolved
@Razican Razican merged commit 3e2e566 into boa-dev:master Jul 15, 2020
@benjaminflin benjaminflin deleted the feature/array-prototype-reduce branch July 20, 2020 04:04
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.

3 participants