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

Fix string prototype trim methods #583

Merged
merged 2 commits into from
Jul 21, 2020
Merged

Conversation

HalidOdat
Copy link
Member

It changes the following:

  • Fixed String.prototype.trim()
  • Fixed String.prototype.trimStart()
  • Fixed String.prototype.trimEnd()
  • Add tests

@HalidOdat HalidOdat added bug Something isn't working builtins PRs and Issues related to builtins/intrinsics labels Jul 21, 2020
@HalidOdat HalidOdat added this to the v0.10.0 milestone Jul 21, 2020
@codecov
Copy link

codecov bot commented Jul 21, 2020

Codecov Report

Merging #583 into master will increase coverage by 0.19%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #583      +/-   ##
==========================================
+ Coverage   70.69%   70.88%   +0.19%     
==========================================
  Files         177      177              
  Lines       11290    11314      +24     
==========================================
+ Hits         7981     8020      +39     
+ Misses       3309     3294      -15     
Impacted Files Coverage Δ
boa/src/builtins/string/mod.rs 41.85% <100.00%> (+4.74%) ⬆️
boa/src/builtins/string/tests.rs 100.00% <100.00%> (ø)

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 5d4d8fe...5688c41. Read the comment docs.

@github-actions
Copy link

Benchmark for 6e78db9

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 329.6±21.16ns 311.1±17.61ns +5.95%
Arithmetic operations (Full) 138.8±9.97µs 140.7±9.05µs -1.35%
Array access (Execution) 12.0±0.94µs 11.7±0.81µs +2.56%
Array access (Full) 157.1±9.14µs 159.8±13.00µs -1.69%
Array creation (Execution) 3.2±0.18ms 3.3±0.18ms -3.03%
Array creation (Full) 3.6±0.23ms 3.5±0.22ms +2.86%
Array pop (Execution) 1251.9±73.59µs 1265.0±73.56µs -1.04%
Array pop (Full) 1639.9±118.17µs 1559.9±80.84µs +5.13%
Boolean Object Access (Execution) 3.6±0.27µs 3.7±0.24µs -2.70%
Boolean Object Access (Full) 159.8±33.41µs 148.9±13.42µs +7.32%
Create Realm 134.7±9.36µs 132.0±8.87µs +2.05%
Dynamic Object Property Access (Execution) 5.5±0.41µs 5.8±0.34µs -5.17%
Dynamic Object Property Access (Full) 152.9±14.36µs 155.8±13.00µs -1.86%
Expression (Lexer) 1929.2±103.30ns 2.0±0.16µs -3.54%
Expression (Parser) 4.7±0.33µs 4.6±0.34µs +2.17%
Fibonacci (Execution) 848.2±58.19µs 845.4±56.79µs +0.33%
Fibonacci (Full) 1056.2±96.86µs 1024.8±75.95µs +3.06%
For loop (Execution) 19.2±1.27µs 19.2±1.40µs 0.00%
For loop (Full) 164.8±21.36µs 161.7±13.97µs +1.92%
For loop (Lexer) 4.4±0.45µs 4.3±0.27µs +2.33%
For loop (Parser) 11.7±0.78µs 12.1±0.82µs -3.31%
Goal Symbols (Parser) 7.3±0.48µs 7.3±0.50µs 0.00%
Hello World (Lexer) 694.8±50.85ns 686.7±41.45ns +1.18%
Hello World (Parser) 1897.6±139.75ns 1889.7±167.71ns +0.42%
Long file (Parser) 5.4±0.26ms 5.4±0.27ms 0.00%
Number Object Access (Execution) 2.7±0.20µs 2.8±0.17µs -3.57%
Number Object Access (Full) 150.2±9.19µs 149.6±11.42µs +0.40%
Object Creation (Execution) 4.8±0.28µs 4.9±0.31µs -2.04%
Object Creation (Full) 169.0±13.32µs 169.6±12.74µs -0.35%
RegExp (Execution) 58.7±3.72µs 58.7±4.54µs 0.00%
RegExp (Full) 209.5±15.00µs 212.2±15.15µs -1.27%
RegExp Literal (Execution) 62.2±12.21µs 61.3±3.71µs +1.47%
RegExp Literal (Full) 216.7±16.07µs 217.0±23.24µs -0.14%
RegExp Literal Creation (Execution) 57.6±3.44µs 59.0±3.84µs -2.37%
RegExp Literal Creation (Full) 259.6±17.45µs 257.3±19.10µs +0.89%
Static Object Property Access (Execution) 5.1±0.50µs 4.9±0.32µs +4.08%
Static Object Property Access (Full) 151.1±14.17µs 150.6±9.57µs +0.33%
String Object Access (Execution) 6.9±0.66µs 6.9±0.51µs 0.00%
String Object Access (Full) 152.4±9.59µs 155.3±9.95µs -1.87%
String comparison (Execution) 5.6±0.37µs 5.5±0.42µs +1.82%
String comparison (Full) 149.2±14.19µs 148.5±9.81µs +0.47%
String concatenation (Execution) 4.7±0.46µs 4.6±0.35µs +2.17%
String concatenation (Full) 148.4±8.52µs 148.1±8.18µs +0.20%
String copy (Execution) 3.6±0.20µs 3.6±0.33µs 0.00%
String copy (Full) 146.3±12.58µs 142.1±8.47µs +2.96%
Symbols (Execution) 3.1±0.21µs 3.1±0.20µs 0.00%
Symbols (Full) 141.3±9.25µs 139.7±10.58µs +1.15%

@Razican Razican merged commit cf25305 into master Jul 21, 2020
@HalidOdat HalidOdat deleted the fix/string-prototype-trim-methods branch August 27, 2020 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working builtins PRs and Issues related to builtins/intrinsics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants