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

Add newTarget to construct #1045

Merged
merged 8 commits into from Jan 12, 2021
Merged

Add newTarget to construct #1045

merged 8 commits into from Jan 12, 2021

Conversation

tofpie
Copy link
Contributor

@tofpie tofpie commented Jan 6, 2021

This Pull Request fixes #1009.

It changes the following:

  • Change the construct method to handle new_target,
  • Change all the built-in constructors to handle new_target
  • Change String constructor to make it more compliant

@Razican Razican added this to the v0.11.0 milestone Jan 6, 2021
@Razican Razican added builtins PRs and Issues related to builtins/intrinsics bug Something isn't working labels Jan 6, 2021
@Razican
Copy link
Member

Razican commented Jan 6, 2021

Test262 conformance changes:

Test result master count PR count difference
Total 78,497 78,497 0
Passed 24,550 24,596 +46
Ignored 15,585 15,585 0
Failed 38,362 38,316 -46
Panics 24 24 0
Conformance 31.28 31.33 +0.06%

@codecov
Copy link

codecov bot commented Jan 6, 2021

Codecov Report

Merging #1045 (265408f) into master (abd893c) will increase coverage by 0.22%.
The diff coverage is 82.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1045      +/-   ##
==========================================
+ Coverage   58.37%   58.59%   +0.22%     
==========================================
  Files         173      173              
  Lines       12050    12214     +164     
==========================================
+ Hits         7034     7157     +123     
- Misses       5016     5057      +41     
Impacted Files Coverage Δ
boa/src/builtins/function/mod.rs 69.64% <0.00%> (-6.09%) ⬇️
boa/src/environment/lexical_environment.rs 67.30% <ø> (-0.32%) ⬇️
boa/src/builtins/symbol/mod.rs 76.86% <66.66%> (-0.41%) ⬇️
boa/src/builtins/string/mod.rs 62.98% <80.00%> (+0.36%) ⬆️
boa/src/builtins/error/eval.rs 70.00% <83.33%> (+5.00%) ⬆️
boa/src/builtins/error/mod.rs 69.38% <83.33%> (+2.72%) ⬆️
boa/src/builtins/error/range.rs 70.00% <83.33%> (+5.00%) ⬆️
boa/src/builtins/error/reference.rs 70.00% <83.33%> (+5.00%) ⬆️
boa/src/builtins/error/syntax.rs 70.00% <83.33%> (+5.00%) ⬆️
boa/src/builtins/error/type.rs 70.00% <83.33%> (+5.00%) ⬆️
... and 11 more

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 abd893c...265408f. Read the comment docs.

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 is looking very good. I had some comments, though. Let me know if you think they make sense :)

boa/src/builtins/error/eval.rs Outdated Show resolved Hide resolved
boa/src/object/gcobject.rs Outdated Show resolved Hide resolved
boa/src/object/gcobject.rs Outdated Show resolved Hide resolved
Copy link
Member

@RageKnify RageKnify left a comment

Choose a reason for hiding this comment

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

Noted some minor changes to improve readability, and minor bugs.

I'm not sure using the first argument for new_targetwhen normally it would be for this is correct (I'd like to get @HalidOdat's opinion on this). There's FunctionEnvironmentRecord.new_target, but that's not really used...

boa/src/builtins/array/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/error/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/error/range.rs Outdated Show resolved Hide resolved
boa/src/builtins/error/reference.rs Outdated Show resolved Hide resolved
boa/src/builtins/error/syntax.rs Outdated Show resolved Hide resolved
boa/src/builtins/error/eval.rs Outdated Show resolved Hide resolved
boa/src/builtins/error/uri.rs Outdated Show resolved Hide resolved
boa/src/builtins/map/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/map/mod.rs Show resolved Hide resolved
boa/src/builtins/string/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@RageKnify RageKnify left a comment

Choose a reason for hiding this comment

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

Code looks good, still unsure about having newTargetbe the first argument of constructors.

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.

I'm ok having newTarget as first argument for now, that can be changed later if we need to or find a better solution. I'm happy to merge this :)

Copy link
Member

@HalidOdat HalidOdat left a comment

Choose a reason for hiding this comment

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

Looks good to me! :)

@RageKnify RageKnify merged commit a7dd470 into boa-dev:master Jan 12, 2021
@tofpie tofpie deleted the constructor-new-target branch January 12, 2021 15:51
@RageKnify RageKnify mentioned this pull request Jan 12, 2021
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.

Invoking constructors changes global this instead of newTarget
4 participants