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 String.prototype.split #1026

Merged
merged 11 commits into from Jan 6, 2021
Merged

Conversation

jevancc
Copy link
Contributor

@jevancc jevancc commented Jan 2, 2021

This Pull Request implements String.prototype.split

It changes the following:

  • Add the method implementation
  • Add unit tests

@codecov
Copy link

codecov bot commented Jan 2, 2021

Codecov Report

Merging #1026 (1a89274) into master (553ea52) will increase coverage by 0.07%.
The diff coverage is 81.08%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1026      +/-   ##
==========================================
+ Coverage   58.69%   58.77%   +0.07%     
==========================================
  Files         172      172              
  Lines       11745    11782      +37     
==========================================
+ Hits         6894     6925      +31     
- Misses       4851     4857       +6     
Impacted Files Coverage Δ
boa/src/builtins/string/mod.rs 62.80% <81.08%> (+1.46%) ⬆️
boa/src/object/gcobject.rs 67.93% <0.00%> (+0.34%) ⬆️

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 553ea52...1a89274. Read the comment docs.

@jevancc jevancc marked this pull request as ready for review January 2, 2021 04:01
@Razican Razican added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics labels Jan 2, 2021
@Razican Razican added this to the v0.11.0 milestone Jan 2, 2021
@Razican
Copy link
Member

Razican commented Jan 2, 2021

I will check the code through the day, but the conformance increase looks really good :)

Test262 conformance changes:

Test result master count PR count difference
Total 78,493 78,493 0
Passed 23,989 24,125 +136
Ignored 15,585 15,585 0
Failed 38,919 38,783 -136
Panics 100 100 0
Conformance 30.56 30.74 +0.17%

@jevancc
Copy link
Contributor Author

jevancc commented Jan 2, 2021

@Razican The three extra panics come from built-ins/map/prototype/keys/returns-iterator.js (no Set implementation) and test/built-ins/string/prototype/split/cstm-split-get-err.js (bug in Object.defineProperty). I have no idea why they did not panic in the master branch but here.

@Razican
Copy link
Member

Razican commented Jan 2, 2021

I have no idea why they did not panic in the master branch but here.

I would guess this now enables some tests to run further, which shows some panics that did not appear before because it was failing early.

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's looking good! I added some sugestions to make the code a bit more idiomatic :)

boa/src/builtins/string/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/string/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/string/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@RageKnify RageKnify 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, noted a few improvements to be closer to the spec.

boa/src/builtins/string/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/string/mod.rs Outdated Show resolved Hide resolved
@RageKnify RageKnify mentioned this pull request Jan 3, 2021
33 tasks
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 good, let's merge it :)

@Razican Razican merged commit e8bc79c into boa-dev:master Jan 6, 2021
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.

None yet

4 participants