Skip to content

Conversation

@JakeChampion
Copy link
Contributor

This pull-request is part of the solution for #113

This pull-request changes our URL implementation to use JS_NewObjectForConstructor when the construction has come from the applications' JavaScript, which assigns the correct prototype to the instance being constructed (taking into account extends in JavaScript)

I've also added a test which confirms that the correct prototype has been assigned when extending from URL, the test is written in a way that makes it simpler to add the same test for any other builtin classes

@JakeChampion JakeChampion marked this pull request as ready for review June 22, 2022 10:27
Copy link
Contributor

@elliottt elliottt 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, just one question about checking an allocated object.

Comment on lines 6811 to 6815
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this check that urlInstance is not nullptr?

@JakeChampion JakeChampion requested a review from elliottt June 22, 2022 23:17
@JakeChampion JakeChampion force-pushed the jake/extend-from-urlsearchparams branch from 95473a3 to 9a14faa Compare June 22, 2022 23:18
Base automatically changed from jake/extend-from-urlsearchparams to main June 23, 2022 13:12
@JakeChampion JakeChampion force-pushed the jake/extend-from-url branch from 2ba6e86 to 396d29d Compare June 23, 2022 13:14
@JakeChampion JakeChampion merged commit c219109 into main Jun 23, 2022
@JakeChampion JakeChampion deleted the jake/extend-from-url branch June 23, 2022 14:37
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.

3 participants