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

Make String.prototype.repeat() ECMAScript specification compliant #582

Merged
merged 1 commit into from
Jul 21, 2020

Conversation

HalidOdat
Copy link
Member

It changes the following:

  • Make String.prototype.repeat() ECMAScript specification compliant
  • Made repeat use Interpreters to_string
  • Added a string limit as V8 and spidermonkey does (2 ^ 32 - 1).
  • Added 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 #582 into master will increase coverage by 0.12%.
The diff coverage is 94.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #582      +/-   ##
==========================================
+ Coverage   70.69%   70.81%   +0.12%     
==========================================
  Files         177      177              
  Lines       11290    11322      +32     
==========================================
+ Hits         7981     8018      +37     
+ Misses       3309     3304       -5     
Impacted Files Coverage Δ
boa/src/builtins/string/mod.rs 38.39% <84.61%> (+1.28%) ⬆️
boa/src/builtins/string/tests.rs 100.00% <100.00%> (ø)
boa/src/exec/exception.rs 64.00% <0.00%> (+8.00%) ⬆️
boa/src/builtins/error/range.rs 76.19% <0.00%> (+19.04%) ⬆️

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...f4a1ddd. Read the comment docs.

@github-actions
Copy link

Benchmark for a10b8e7

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 374.1±8.83ns 376.7±11.43ns -0.69%
Arithmetic operations (Full) 170.6±13.71µs 166.1±2.77µs +2.71%
Array access (Execution) 14.2±0.34µs 14.2±0.28µs 0.00%
Array access (Full) 189.2±4.22µs 189.8±3.35µs -0.32%
Array creation (Execution) 3.9±0.05ms 3.9±0.10ms 0.00%
Array creation (Full) 4.2±0.04ms 4.2±0.06ms 0.00%
Array pop (Execution) 1529.4±22.91µs 1506.4±62.38µs +1.53%
Array pop (Full) 1889.3±57.63µs 1868.2±58.98µs +1.13%
Boolean Object Access (Execution) 4.2±0.10µs 4.2±0.11µs 0.00%
Boolean Object Access (Full) 178.1±3.71µs 176.7±5.57µs +0.79%
Create Realm 156.6±2.96µs 157.1±5.53µs -0.32%
Dynamic Object Property Access (Execution) 6.6±0.11µs 6.7±0.11µs -1.49%
Dynamic Object Property Access (Full) 182.6±7.58µs 179.5±5.01µs +1.73%
Expression (Lexer) 2.4±0.08µs 2.4±0.04µs 0.00%
Expression (Parser) 5.5±0.08µs 5.5±0.10µs 0.00%
Fibonacci (Execution) 985.2±28.03µs 998.8±43.61µs -1.36%
Fibonacci (Full) 1206.4±50.19µs 1234.1±93.75µs -2.24%
For loop (Execution) 22.9±0.96µs 22.8±0.44µs +0.44%
For loop (Full) 196.2±4.11µs 198.8±8.48µs -1.31%
For loop (Lexer) 5.3±0.10µs 5.3±0.14µs 0.00%
For loop (Parser) 14.3±0.25µs 14.3±0.23µs 0.00%
Goal Symbols (Parser) 8.7±0.31µs 8.6±0.19µs +1.16%
Hello World (Lexer) 831.2±25.74ns 829.9±22.43ns +0.16%
Hello World (Parser) 2.2±0.10µs 2.2±0.03µs 0.00%
Long file (Parser) 6.4±0.08ms 6.3±0.05ms +1.59%
Number Object Access (Execution) 3.3±0.05µs 3.4±0.07µs -2.94%
Number Object Access (Full) 174.2±3.50µs 178.1±2.97µs -2.19%
Object Creation (Execution) 5.7±0.14µs 5.7±0.17µs 0.00%
Object Creation (Full) 198.0±3.14µs 198.7±3.67µs -0.35%
RegExp (Execution) 67.3±1.55µs 68.7±3.11µs -2.04%
RegExp (Full) 259.9±8.35µs 256.0±7.40µs +1.52%
RegExp Literal (Execution) 71.5±2.25µs 72.3±2.16µs -1.11%
RegExp Literal (Full) 257.3±4.53µs 254.3±8.74µs +1.18%
RegExp Literal Creation (Execution) 68.3±1.86µs 68.4±1.75µs -0.15%
RegExp Literal Creation (Full) 300.9±11.15µs 299.0±7.00µs +0.64%
Static Object Property Access (Execution) 5.8±0.19µs 5.8±0.08µs 0.00%
Static Object Property Access (Full) 177.1±3.82µs 177.7±4.82µs -0.34%
String Object Access (Execution) 8.1±0.21µs 8.3±0.33µs -2.41%
String Object Access (Full) 183.0±4.53µs 182.3±10.45µs +0.38%
String comparison (Execution) 6.5±0.10µs 6.6±0.26µs -1.52%
String comparison (Full) 181.5±6.73µs 181.7±10.96µs -0.11%
String concatenation (Execution) 5.5±0.13µs 5.5±0.11µs 0.00%
String concatenation (Full) 177.4±5.02µs 175.4±3.46µs +1.14%
String copy (Execution) 4.2±0.06µs 4.3±0.07µs -2.33%
String copy (Full) 174.3±3.62µs 174.7±5.26µs -0.23%
Symbols (Execution) 3.7±0.13µs 3.7±0.11µs 0.00%
Symbols (Full) 165.4±3.54µs 166.8±3.33µs -0.84%

@HalidOdat HalidOdat merged commit bbed032 into master Jul 21, 2020
@HalidOdat HalidOdat deleted the fix/string-prototype-repeat branch July 21, 2020 22:30
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.

2 participants