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

Bugfix: Printing of native class prototypes #67

Merged
merged 1 commit into from
Oct 30, 2023
Merged

Conversation

ryutamago
Copy link
Collaborator

@ryutamago ryutamago commented Oct 24, 2023

Context

There was a bug associated with converting the prototype of URL and URLSearchParam to string.
This is because the to_string methods we have only handles the conversion fromURL and URLSearchParam, not the their prototypes.

Description

Made changes to the URL and URLSearchParam so that in case the js value is not of type Self, call the builtin Object's to_string method

Manually testing the PR

In repl,

>> console.log(URL)
[🪵] function URL() { [native code] }
>> console.log(URLSearchParams)
[🪵] function URLSearchParams() { [native code] }
>> console.log(URL.prototype)
[🪵] [object Object]
>> console.log(URLSearchParams.prototype)
[🪵] [object Object]

@ryutamago ryutamago force-pushed the leo@fix-url-to-string branch 4 times, most recently from 8285d90 to 95d7e59 Compare October 26, 2023 18:47
@ryutamago ryutamago marked this pull request as ready for review October 26, 2023 18:49
@johnyob johnyob changed the title Fix URL to_string Bugfix: Printing of native class prototypes Oct 27, 2023
@ryutamago ryutamago force-pushed the leo@fix-url-to-string branch 3 times, most recently from 0555c7f to 13ad181 Compare October 27, 2023 15:14
Copy link
Collaborator

@johnyob johnyob left a comment

Choose a reason for hiding this comment

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

LGTM.

Please squash before merging (commit history is a little messy)

@johnyob johnyob merged commit bb83515 into main Oct 30, 2023
5 checks passed
@johnyob johnyob deleted the leo@fix-url-to-string branch October 30, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants