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 sending this value to function environments #526

Merged
merged 3 commits into from
Jun 25, 2020
Merged

Fix sending this value to function environments #526

merged 3 commits into from
Jun 25, 2020

Conversation

jasonwilliams
Copy link
Member

@jasonwilliams jasonwilliams commented Jun 25, 2020

This Pull Request fixes/closes #511.

… `None` for initial `this` value

* Call `bind_this_value` to properly set up `this` binding in functions
@jasonwilliams jasonwilliams changed the title * Arrow functions are lexical and have no this, they should also pass… Fix sending this value to function environments Jun 25, 2020
@codecov
Copy link

codecov bot commented Jun 25, 2020

Codecov Report

Merging #526 into master will increase coverage by 0.05%.
The diff coverage is 72.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #526      +/-   ##
==========================================
+ Coverage   68.05%   68.10%   +0.05%     
==========================================
  Files         169      169              
  Lines        9932     9942      +10     
==========================================
+ Hits         6759     6771      +12     
+ Misses       3173     3171       -2     
Impacted Files Coverage Δ
boa/src/environment/function_environment_record.rs 25.00% <0.00%> (+4.16%) ⬆️
boa/src/builtins/function/mod.rs 69.42% <55.55%> (-0.11%) ⬇️
boa/src/environment/lexical_environment.rs 74.75% <100.00%> (ø)
boa/src/exec/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 3fe8942...afd70ce. Read the comment docs.

@github-actions
Copy link

Benchmark for c3e2118

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 591.6±16.89ns 589.9±24.59ns +0.29%
Array access (Execution) 14.3±0.55µs 14.2±0.68µs +0.70%
Array creation (Execution) 4.0±0.16ms 3.9±0.06ms +2.56%
Array pop (Execution) 1525.4±68.98µs 1492.9±95.67µs +2.18%
Boolean Object Access (Execution) 5.5±0.19µs 5.4±0.21µs +1.85%
Create Realm 143.7±8.48µs 137.4±4.75µs +4.59%
Dynamic Object Property Access (Execution) 7.4±0.35µs 7.3±0.22µs +1.37%
Expression (Lexer) 2.2±0.07µs 2.1±0.06µs +4.76%
Expression (Parser) 5.2±0.25µs 5.2±0.22µs 0.00%
Fibonacci (Execution) 1014.6±32.65µs 1040.9±63.77µs -2.53%
For loop (Execution) 24.1±1.04µs 23.8±1.05µs +1.26%
For loop (Lexer) 5.7±1.37µs 5.4±0.13µs +5.56%
For loop (Parser) 14.0±0.52µs 13.9±0.28µs +0.72%
Hello World (Lexer) 992.5±84.62ns 958.6±41.93ns +3.54%
Hello World (Parser) 2.3±0.10µs 2.3±0.07µs 0.00%
Long file (Parser) 6.4±0.13ms 6.4±0.13ms 0.00%
Number Object Access (Execution) 4.3±0.20µs 4.3±0.13µs 0.00%
Object Creation (Execution) 6.5±0.34µs 6.4±0.27µs +1.56%
RegExp (Execution) 77.5±7.53µs 75.9±8.92µs +2.11%
RegExp Literal (Execution) 80.6±8.90µs 78.5±2.50µs +2.68%
RegExp Literal Creation (Execution) 77.8±5.79µs 73.7±2.93µs +5.56%
Static Object Property Access (Execution) 6.9±0.40µs 6.5±0.23µs +6.15%
String Object Access (Execution) 8.9±0.21µs 9.1±0.34µs -2.20%
String comparison (Execution) 7.2±0.29µs 7.1±0.42µs +1.41%
String concatenation (Execution) 6.1±0.18µs 6.1±0.27µs 0.00%
String copy (Execution) 4.8±0.24µs 4.8±0.33µs 0.00%
Symbols (Execution) 4.3±0.17µs 4.2±0.17µs +2.38%

* updated editorConfig
* removed problemMatcher from tasks.json
@github-actions
Copy link

Benchmark for 6537aed

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 551.1±19.89ns 553.4±24.69ns -0.42%
Array access (Execution) 13.6±0.40µs 13.3±0.63µs +2.26%
Array creation (Execution) 3.8±0.11ms 3.8±0.09ms 0.00%
Array pop (Execution) 1401.0±47.88µs 1421.6±54.33µs -1.45%
Boolean Object Access (Execution) 5.1±0.20µs 5.3±0.25µs -3.77%
Create Realm 135.2±3.88µs 133.4±5.12µs +1.35%
Dynamic Object Property Access (Execution) 6.8±0.33µs 7.1±0.22µs -4.23%
Expression (Lexer) 2.0±0.16µs 1996.1±110.75ns +0.20%
Expression (Parser) 4.9±0.19µs 4.9±0.15µs 0.00%
Fibonacci (Execution) 961.3±25.31µs 977.0±38.97µs -1.61%
For loop (Execution) 23.0±0.88µs 23.4±0.70µs -1.71%
For loop (Lexer) 5.1±0.20µs 5.2±0.14µs -1.92%
For loop (Parser) 13.7±0.60µs 13.2±0.54µs +3.79%
Hello World (Lexer) 921.2±36.57ns 905.1±30.11ns +1.78%
Hello World (Parser) 2.1±0.12µs 2.1±0.10µs 0.00%
Long file (Parser) 6.0±0.12ms 6.0±0.15ms 0.00%
Number Object Access (Execution) 4.2±0.14µs 4.0±0.23µs +5.00%
Object Creation (Execution) 6.0±0.30µs 6.1±0.25µs -1.64%
RegExp (Execution) 69.4±3.53µs 71.0±3.22µs -2.25%
RegExp Literal (Execution) 74.6±3.24µs 74.1±3.09µs +0.67%
RegExp Literal Creation (Execution) 70.8±2.69µs 71.8±5.55µs -1.39%
Static Object Property Access (Execution) 6.3±0.19µs 6.4±0.26µs -1.56%
String Object Access (Execution) 8.7±0.47µs 8.9±0.36µs -2.25%
String comparison (Execution) 6.7±0.31µs 6.8±0.23µs -1.47%
String concatenation (Execution) 5.7±0.19µs 5.7±0.24µs 0.00%
String copy (Execution) 4.4±0.20µs 4.6±0.13µs -4.35%
Symbols (Execution) 4.0±0.15µs 4.1±0.12µs -2.44%

@HalidOdat HalidOdat added bug Something isn't working execution Issues or PRs related to code execution labels Jun 25, 2020
@HalidOdat HalidOdat added this to the v0.9.0 milestone Jun 25, 2020
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.

This looks almost perfect. Check my comment about the new line, but from my side it's ready :)

.editorConfig Outdated
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a new line at the end of this file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah i don't know why my VSCode is not respecting that file for this haha

@github-actions
Copy link

Benchmark for 18b5a59

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 588.8±10.56ns 585.8±15.06ns +0.51%
Array access (Execution) 14.1±0.36µs 14.1±0.39µs 0.00%
Array creation (Execution) 3.7±0.13ms 3.7±0.06ms 0.00%
Array pop (Execution) 1374.7±39.20µs 1385.0±21.25µs -0.74%
Boolean Object Access (Execution) 5.5±0.17µs 5.5±0.11µs 0.00%
Create Realm 140.7±3.10µs 141.1±4.58µs -0.28%
Dynamic Object Property Access (Execution) 7.5±0.23µs 7.4±0.24µs +1.35%
Expression (Lexer) 2.1±0.05µs 2.1±0.07µs 0.00%
Expression (Parser) 5.3±0.23µs 5.0±0.11µs +6.00%
Fibonacci (Execution) 1082.5±37.33µs 1056.3±16.63µs +2.48%
For loop (Execution) 24.2±0.68µs 23.8±0.56µs +1.68%
For loop (Lexer) 5.4±0.10µs 5.4±0.17µs 0.00%
For loop (Parser) 14.9±0.89µs 13.9±0.43µs +7.19%
Hello World (Lexer) 970.2±26.03ns 971.0±17.78ns -0.08%
Hello World (Parser) 2.5±0.10µs 2.3±0.07µs +8.70%
Long file (Parser) 6.5±0.09ms 6.5±0.08ms 0.00%
Number Object Access (Execution) 4.3±0.10µs 4.3±0.09µs 0.00%
Object Creation (Execution) 6.5±0.09µs 6.7±0.37µs -2.99%
RegExp (Execution) 79.6±2.77µs 81.6±1.85µs -2.45%
RegExp Literal (Execution) 84.3±2.03µs 84.1±4.08µs +0.24%
RegExp Literal Creation (Execution) 79.4±2.38µs 79.6±2.75µs -0.25%
Static Object Property Access (Execution) 6.8±0.21µs 6.8±0.26µs 0.00%
String Object Access (Execution) 9.2±0.30µs 9.2±0.33µs 0.00%
String comparison (Execution) 7.3±0.27µs 7.2±0.18µs +1.39%
String concatenation (Execution) 6.1±0.15µs 6.0±0.13µs +1.67%
String copy (Execution) 5.0±0.10µs 4.8±0.12µs +4.17%
Symbols (Execution) 4.3±0.14µs 4.3±0.08µs 0.00%

@Razican Razican merged commit c4a652a into master Jun 25, 2020
@Razican Razican deleted the fix/511 branch June 25, 2020 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working execution Issues or PRs related to code execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Call] Usage of "this" in methods is not supported
3 participants