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

Fixed String.prototype.indexOf() bug, when the search string is empty #599

Merged
merged 1 commit into from
Jul 31, 2020

Conversation

HalidOdat
Copy link
Member

It changes the following:

  • Fixed String.prototype.indexOf() bug, when the search string is empty
  • Added test.

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

codecov bot commented Jul 30, 2020

Codecov Report

Merging #599 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #599      +/-   ##
==========================================
+ Coverage   71.23%   71.26%   +0.02%     
==========================================
  Files         177      177              
  Lines       11588    11598      +10     
==========================================
+ Hits         8255     8265      +10     
  Misses       3333     3333              
Impacted Files Coverage Δ
boa/src/builtins/string/mod.rs 46.86% <100.00%> (+0.29%) ⬆️
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 9a3b69f...d3017d8. Read the comment docs.

@github-actions
Copy link

Benchmark for 65771d2

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 365.1±13.54ns 388.7±12.54ns -6.07%
Arithmetic operations (Full) 188.7±10.34µs 188.3±9.44µs +0.21%
Array access (Execution) 9.3±0.34µs 9.5±0.41µs -2.11%
Array access (Full) 205.3±5.66µs 210.6±7.48µs -2.52%
Array creation (Execution) 3.2±0.10ms 3.4±0.09ms -5.88%
Array creation (Full) 3.7±0.14ms 3.6±0.09ms +2.78%
Array pop (Execution) 1182.4±49.37µs 1229.6±153.51µs -3.84%
Array pop (Full) 1521.7±54.51µs 1532.4±43.61µs -0.70%
Boolean Object Access (Execution) 4.9±0.21µs 5.0±0.19µs -2.00%
Boolean Object Access (Full) 204.4±13.19µs 197.4±7.50µs +3.55%
Create Realm 459.6±109.84ns 449.2±16.03ns +2.32%
Dynamic Object Property Access (Execution) 5.9±0.22µs 5.8±0.46µs +1.72%
Dynamic Object Property Access (Full) 207.9±14.20µs 204.6±7.57µs +1.61%
Expression (Lexer) 2.5±0.17µs 2.5±0.09µs 0.00%
Expression (Parser) 5.3±0.17µs 5.3±0.17µs 0.00%
Fibonacci (Execution) 1076.9±52.50µs 1082.4±60.13µs -0.51%
Fibonacci (Full) 1320.5±58.39µs 1324.7±66.98µs -0.32%
For loop (Execution) 24.4±1.90µs 23.4±0.87µs +4.27%
For loop (Full) 217.4±13.56µs 224.4±11.80µs -3.12%
For loop (Lexer) 5.4±0.21µs 5.5±0.31µs -1.82%
For loop (Parser) 15.1±0.64µs 14.9±1.05µs +1.34%
Goal Symbols (Parser) 8.6±0.40µs 9.3±0.80µs -7.53%
Hello World (Lexer) 868.8±45.82ns 880.7±44.85ns -1.35%
Hello World (Parser) 2.2±0.08µs 2.2±0.11µs 0.00%
Long file (Parser) 6.7±0.22ms 6.8±0.27ms -1.47%
Number Object Access (Execution) 3.8±0.25µs 3.9±0.19µs -2.56%
Number Object Access (Full) 196.2±7.57µs 196.6±5.64µs -0.20%
Object Creation (Execution) 5.0±0.14µs 5.0±0.22µs 0.00%
Object Creation (Full) 225.0±7.05µs 231.9±7.64µs -2.98%
RegExp (Execution) 76.3±2.53µs 77.5±3.17µs -1.55%
RegExp (Full) 314.3±13.37µs 326.7±11.81µs -3.80%
RegExp Literal (Execution) 76.8±3.86µs 77.5±2.66µs -0.90%
RegExp Literal (Full) 281.4±9.24µs 294.4±13.30µs -4.42%
RegExp Literal Creation (Execution) 73.2±2.17µs 75.8±13.76µs -3.43%
RegExp Literal Creation (Full) 324.0±14.42µs 318.9±14.15µs +1.60%
Static Object Property Access (Execution) 5.3±0.16µs 5.2±0.27µs +1.92%
Static Object Property Access (Full) 205.3±11.32µs 202.2±6.61µs +1.53%
String Object Access (Execution) 6.9±0.35µs 7.4±0.38µs -6.76%
String Object Access (Full) 200.8±6.99µs 205.1±17.60µs -2.10%
String comparison (Execution) 7.1±0.33µs 7.2±0.32µs -1.39%
String comparison (Full) 195.7±18.94µs 203.7±13.16µs -3.93%
String concatenation (Execution) 5.7±0.20µs 5.9±0.23µs -3.39%
String concatenation (Full) 194.0±7.85µs 199.5±5.37µs -2.76%
String copy (Execution) 4.4±0.15µs 4.4±0.20µs 0.00%
String copy (Full) 190.9±8.00µs 198.6±5.27µs -3.88%
Symbols (Execution) 3.4±0.15µs 3.5±0.12µs -2.86%
Symbols (Full) 184.3±6.76µs 189.2±6.62µs -2.59%

@HalidOdat HalidOdat merged commit 9fdadf8 into master Jul 31, 2020
@HalidOdat HalidOdat deleted the fix/indexof-empty-search-string branch July 31, 2020 21:07
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 execution Issues or PRs related to code execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants