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

Refactor function internal methods #3322

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

HalidOdat
Copy link
Member

This PR separates the native function from JavaScript function, their internal methods and their storage.

This allows us to remove some unneeded check as well as makes #3295 easier to implement.

@HalidOdat HalidOdat added this to the v0.18.0 milestone Sep 29, 2023
@github-actions
Copy link

github-actions bot commented Sep 29, 2023

Test262 conformance changes

Test result main count PR count difference
Total 95,574 95,574 0
Passed 75,201 75,271 +70
Ignored 19,482 19,482 0
Failed 891 821 -70
Panics 0 0 0
Conformance 78.68% 78.76% +0.07%
Fixed tests (70):
test/built-ins/Function/prototype/toString/setter-class-statement-static.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/setter-class-statement-static.js (previously Failed)
test/built-ins/Function/prototype/toString/setter-class-statement.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/setter-class-statement.js (previously Failed)
test/built-ins/Function/prototype/toString/setter-object.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/setter-object.js (previously Failed)
test/built-ins/Function/prototype/toString/getter-class-expression.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/getter-class-expression.js (previously Failed)
test/built-ins/Function/prototype/toString/method-class-expression.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/method-class-expression.js (previously Failed)
test/built-ins/Function/prototype/toString/symbol-named-builtins.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/symbol-named-builtins.js (previously Failed)
test/built-ins/Function/prototype/toString/getter-class-statement.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/getter-class-statement.js (previously Failed)
test/built-ins/Function/prototype/toString/private-method-class-expression.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/private-method-class-expression.js (previously Failed)
test/built-ins/Function/prototype/toString/function-declaration-non-simple-parameter-list.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/function-declaration-non-simple-parameter-list.js (previously Failed)
test/built-ins/Function/prototype/toString/function-expression.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/function-expression.js (previously Failed)
test/built-ins/Function/prototype/toString/getter-class-statement-static.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/getter-class-statement-static.js (previously Failed)
test/built-ins/Function/prototype/toString/getter-class-expression-static.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/getter-class-expression-static.js (previously Failed)
test/built-ins/Function/prototype/toString/method-class-expression-static.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/method-class-expression-static.js (previously Failed)
test/built-ins/Function/prototype/toString/method-class-statement-static.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/method-class-statement-static.js (previously Failed)
test/built-ins/Function/prototype/toString/class-declaration-implicit-ctor.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/class-declaration-implicit-ctor.js (previously Failed)
test/built-ins/Function/prototype/toString/unicode.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/unicode.js (previously Failed)
test/built-ins/Function/prototype/toString/private-method-class-statement.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/private-method-class-statement.js (previously Failed)
test/built-ins/Function/prototype/toString/class-expression-explicit-ctor.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/class-expression-explicit-ctor.js (previously Failed)
test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR.js (previously Failed)
test/built-ins/Function/prototype/toString/setter-class-expression-static.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/setter-class-expression-static.js (previously Failed)
test/built-ins/Function/prototype/toString/getter-object.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/getter-object.js (previously Failed)
test/built-ins/Function/prototype/toString/class-expression-implicit-ctor.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/class-expression-implicit-ctor.js (previously Failed)
test/built-ins/Function/prototype/toString/setter-class-expression.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/setter-class-expression.js (previously Failed)
test/built-ins/Function/prototype/toString/Function.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/Function.js (previously Failed)
test/built-ins/Function/prototype/toString/line-terminator-normalisation-LF.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/line-terminator-normalisation-LF.js (previously Failed)
test/built-ins/Function/prototype/toString/private-static-method-class-expression.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/private-static-method-class-expression.js (previously Failed)
test/built-ins/Function/prototype/toString/method-object.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/method-object.js (previously Failed)
test/built-ins/Function/prototype/toString/arrow-function.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/arrow-function.js (previously Failed)
test/built-ins/Function/prototype/toString/function-declaration.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/function-declaration.js (previously Failed)
test/built-ins/Function/prototype/toString/private-static-method-class-statement.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/private-static-method-class-statement.js (previously Failed)
test/built-ins/Function/prototype/toString/class-declaration-complex-heritage.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/class-declaration-complex-heritage.js (previously Failed)
test/built-ins/Function/prototype/toString/built-in-function-object.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/built-in-function-object.js (previously Failed)
test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR-LF.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR-LF.js (previously Failed)
test/built-ins/Function/prototype/toString/method-class-statement.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/method-class-statement.js (previously Failed)
test/built-ins/Function/prototype/toString/class-declaration-explicit-ctor.js [strict mode] (previously Failed)
test/built-ins/Function/prototype/toString/class-declaration-explicit-ctor.js (previously Failed)

@HalidOdat HalidOdat force-pushed the refactor/function-internal-methods branch from 4f96143 to e97db0c Compare September 30, 2023 13:05
@codecov
Copy link

codecov bot commented Sep 30, 2023

Codecov Report

Attention: 83 lines in your changes are missing coverage. Please review.

Comparison is base (4bdb6c6) 49.45% compared to head (e72c22a) 49.46%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3322      +/-   ##
==========================================
+ Coverage   49.45%   49.46%   +0.01%     
==========================================
  Files         446      446              
  Lines       43948    43896      -52     
==========================================
- Hits        21733    21715      -18     
+ Misses      22215    22181      -34     
Files Coverage Δ
boa_engine/src/builtins/error/type.rs 82.69% <100.00%> (-0.33%) ⬇️
boa_engine/src/builtins/mod.rs 92.49% <100.00%> (-0.07%) ⬇️
boa_engine/src/object/builtins/jsfunction.rs 57.14% <ø> (ø)
...gine/src/object/internal_methods/bound_function.rs 0.00% <ø> (ø)
boa_engine/src/object/internal_methods/proxy.rs 3.35% <ø> (ø)
boa_engine/src/object/jsobject.rs 52.36% <71.42%> (-0.42%) ⬇️
boa_engine/src/object/operations.rs 48.55% <62.50%> (-0.16%) ⬇️
boa_engine/src/object/internal_methods/mod.rs 84.61% <58.33%> (-1.75%) ⬇️
boa_cli/src/debug/function.rs 0.00% <0.00%> (ø)
boa_engine/src/object/mod.rs 31.56% <75.00%> (+0.76%) ⬆️
... and 4 more

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HalidOdat HalidOdat marked this pull request as ready for review September 30, 2023 15:06
@HalidOdat HalidOdat requested a review from a team September 30, 2023 15:06
@raskad raskad requested a review from a team October 1, 2023 22:33
@HalidOdat HalidOdat force-pushed the refactor/function-internal-methods branch from e97db0c to e1ad95b Compare October 2, 2023 23:34
@HalidOdat HalidOdat force-pushed the refactor/function-internal-methods branch from e1ad95b to e72c22a Compare October 2, 2023 23:39
Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Nice refactoring!

@jedel1043 jedel1043 added this pull request to the merge queue Oct 3, 2023
Merged via the queue into main with commit 7445367 Oct 3, 2023
14 checks passed
@HalidOdat HalidOdat deleted the refactor/function-internal-methods branch October 3, 2023 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants