Skip to content

Allow TextDecoder to be used as a base class to extend from within application javascript #122

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

Merged
merged 1 commit into from
Jun 21, 2022

Conversation

JakeChampion
Copy link
Contributor

@JakeChampion JakeChampion commented Jun 21, 2022

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

This pull-request changes our TextDecoder 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 TextDecoder, the test is written in a way that makes it simpler to add the same test for any other builtin classes

@JakeChampion JakeChampion changed the title Allow Dictionary to be used as a base class to extend from within application javascript Allow TextDecoder to be used as a base class to extend from within application javascript Jun 21, 2022
@JakeChampion JakeChampion marked this pull request as ready for review June 21, 2022 16:36
Base automatically changed from jake/extend-from-cacheoverride to jake/extend-from-dictionary June 21, 2022 16:39
@JakeChampion JakeChampion force-pushed the jake/extend-from-dictionary branch from 00b31b4 to 35fbcd6 Compare June 21, 2022 16:51
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.

👍

Base automatically changed from jake/extend-from-dictionary to main June 21, 2022 17:05
@JakeChampion JakeChampion force-pushed the jake/extend-from-textdecoder branch from d080150 to 4b08207 Compare June 21, 2022 17:05
@JakeChampion JakeChampion merged commit 11bd86a into main Jun 21, 2022
@JakeChampion JakeChampion deleted the jake/extend-from-textdecoder branch June 21, 2022 17:31
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