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

iclass: Propagate removal of method from including/prepending modules. #2553

Merged
merged 1 commit into from
Jun 15, 2023

Conversation

hmdne
Copy link
Member

@hmdne hmdne commented Jun 9, 2023

How does including/prepending a module work in Opal in short - we create a new JavaScript "class" so to speak, called an iclass. We copy the methods from a module to that iclass and then we inject that iclass into the prototype chain.

Unfortunately, before this commit, if a method was removed from a module, an iclass wouldn't get updated.

This was needed for Flexmock to work under Opal. I believe this will also allow us to make RSpec-Mocks to pass a lot more tests in Opal-RSpec.

I am particularly excited about this fix :D

This PR has been sponsored by Ribose Inc. ref: plurimath/plurimath#159

How does including/prepending a module work in Opal in short -
we create a new JavaScript "class" so to speak, called an `iclass`.
We copy the methods from a module to that `iclass` and then we
inject that `iclass` into the prototype chain.

Unfortunately, before this commit, if a method was removed from
a module, an iclass wouldn't get updated.

This was needed for Flexmock to work under Opal. I believe this
will also allow us to make RSpec-Mocks to pass a lot more tests
in Opal-RSpec.

I am particularly excited about this fix :D

This PR has been sponsored by Ribose Inc. ref: plurimath/plurimath#159
@hmdne hmdne merged commit 6383f2a into master Jun 15, 2023
21 checks passed
@hmdne hmdne deleted the hmdne/iclass-remove-method branch June 15, 2023 08:32
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.

None yet

2 participants