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 Function.prototype a function #802

Merged
merged 1 commit into from
Oct 5, 2020
Merged

Conversation

HalidOdat
Copy link
Member

The Function.prototype is itself a function that has __proto__ == Object.prototype. I Know this is very weird

It changes the following:

  • Make Function.prototype a function that return undefined
  • Add tests

Here is the spec:
Screenshot_2020-10-05_22-53-09

@HalidOdat HalidOdat added bug Something isn't working enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics labels Oct 5, 2020
@HalidOdat HalidOdat added this to the v0.11.0 milestone Oct 5, 2020
@codecov
Copy link

codecov bot commented Oct 5, 2020

Codecov Report

Merging #802 into master will increase coverage by 0.07%.
The diff coverage is 72.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #802      +/-   ##
==========================================
+ Coverage   59.28%   59.35%   +0.07%     
==========================================
  Files         155      155              
  Lines        9924     9945      +21     
==========================================
+ Hits         5883     5903      +20     
- Misses       4041     4042       +1     
Impacted Files Coverage Δ
boa/src/object/mod.rs 46.68% <68.75%> (+1.06%) ⬆️
boa/src/builtins/function/mod.rs 62.24% <83.33%> (+2.02%) ⬆️
boa/src/value/mod.rs 72.79% <0.00%> (+0.50%) ⬆️
boa/src/object/gcobject.rs 74.78% <0.00%> (+1.68%) ⬆️

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

@github-actions
Copy link

github-actions bot commented Oct 5, 2020

Benchmark for f30c6e4

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 370.2±0.19ns 370.2±0.15ns 0.00%
Arithmetic operations (Full) 253.4±0.53µs 252.6±0.62µs +0.32%
Array access (Execution) 7.9±0.03µs 7.9±0.03µs 0.00%
Array access (Full) 273.6±0.40µs 274.3±0.73µs -0.26%
Array creation (Execution) 3.2±0.00ms 3.4±0.00ms -5.88%
Array creation (Full) 3.7±0.00ms 3.7±0.00ms 0.00%
Array pop (Execution) 1129.0±25.43µs 1210.0±5.70µs -6.69%
Array pop (Full) 1677.5±5.69µs 1675.3±9.18µs +0.13%
Boolean Object Access (Execution) 5.0±0.01µs 5.0±0.01µs 0.00%
Boolean Object Access (Full) 267.3±2.48µs 263.1±0.65µs +1.60%
Clean js (Execution) 730.4±3.54µs 745.4±4.19µs -2.01%
Clean js (Full) 1046.2±13.40µs 1039.7±8.40µs +0.63%
Clean js (Parser) 36.1±0.03µs 35.9±0.05µs +0.56%
Create Realm 474.9±0.19ns 474.0±0.31ns +0.19%
Dynamic Object Property Access (Execution) 5.6±0.01µs 5.6±0.02µs 0.00%
Dynamic Object Property Access (Full) 266.7±0.60µs 264.3±0.60µs +0.91%
Expression (Parser) 6.8±0.01µs 6.7±0.01µs +1.49%
Fibonacci (Execution) 812.7±0.70µs 822.9±5.34µs -1.24%
Fibonacci (Full) 1114.7±1.54µs 1101.7±1.92µs +1.18%
For loop (Execution) 22.2±0.07µs 22.5±0.11µs -1.33%
For loop (Full) 289.6±0.50µs 286.5±0.72µs +1.08%
For loop (Parser) 17.7±0.02µs 17.6±0.03µs +0.57%
Goal Symbols (Parser) 12.1±0.09µs 12.0±0.02µs +0.83%
Hello World (Parser) 3.1±0.01µs 3.1±0.01µs 0.00%
Long file (Parser) 767.9±0.89ns 772.4±1.23ns -0.58%
Mini js (Execution) 661.0±13.34µs 672.6±5.92µs -1.72%
Mini js (Full) 956.8±4.83µs 960.9±3.30µs -0.43%
Mini js (Parser) 31.7±0.13µs 31.7±0.03µs 0.00%
Number Object Access (Execution) 4.0±0.00µs 4.1±0.01µs -2.44%
Number Object Access (Full) 261.4±2.12µs 258.8±0.58µs +1.00%
Object Creation (Execution) 4.7±0.02µs 4.7±0.02µs 0.00%
Object Creation (Full) 266.0±1.35µs 261.1±0.98µs +1.88%
RegExp (Execution) 65.5±0.84µs 65.6±0.86µs -0.15%
RegExp (Full) 344.1±1.01µs 341.1±0.85µs +0.88%
RegExp Literal (Execution) 68.5±1.14µs 68.7±1.39µs -0.29%
RegExp Literal (Full) 346.3±1.33µs 340.6±0.70µs +1.67%
RegExp Literal Creation (Execution) 65.6±0.92µs 65.8±0.89µs -0.30%
RegExp Literal Creation (Full) 338.7±0.91µs 337.4±0.76µs +0.39%
Static Object Property Access (Execution) 5.0±0.01µs 5.0±0.06µs 0.00%
Static Object Property Access (Full) 266.8±0.56µs 265.0±0.50µs +0.68%
String Object Access (Execution) 7.2±0.10µs 7.2±0.02µs 0.00%
String Object Access (Full) 269.0±0.56µs 268.0±0.60µs +0.37%
String comparison (Execution) 6.3±0.01µs 6.5±0.02µs -3.08%
String comparison (Full) 269.8±0.42µs 264.8±0.32µs +1.89%
String concatenation (Execution) 5.1±0.01µs 5.3±0.01µs -3.77%
String concatenation (Full) 262.0±0.35µs 261.3±0.27µs +0.27%
String copy (Execution) 3.9±0.01µs 4.0±0.01µs -2.50%
String copy (Full) 256.7±0.43µs 254.7±0.51µs +0.79%
Symbols (Execution) 3.3±0.01µs 3.3±0.01µs 0.00%
Symbols (Full) 254.8±0.47µs 252.1±0.40µs +1.07%

@HalidOdat HalidOdat merged commit ff25a8a into master Oct 5, 2020
@HalidOdat HalidOdat deleted the fix/function-prototype branch October 5, 2020 21: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 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.

2 participants