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

Disambiguate super from this inheritance #2854

Merged
merged 2 commits into from
Oct 18, 2024
Merged

Disambiguate super from this inheritance #2854

merged 2 commits into from
Oct 18, 2024

Conversation

davidmcguiredesign
Copy link
Contributor

Description

If the child class inherits a function, calling it from super behaves identically to calling it from this. But by overriding the inherited definition, the example can now demonstrate that super bypasses the child’s definition.

Motivation

Understanding super is easier when contrasted with this than when defined in (comparative) isolation.

If the child class inherits a function, calling it from `super` behaves identically to calling it from `this`. But by overriding the inherited definition, the example demonstrates that `super` bypasses the child’s definition and goes to the parent’s instead.
@davidmcguiredesign davidmcguiredesign requested a review from a team as a code owner October 18, 2024 17:23
@davidmcguiredesign davidmcguiredesign requested review from Josh-Cena and removed request for a team October 18, 2024 17:23
Copy link

It looks like this is your first pull request. 🎉 Thank you for your contribution! One of the project maintainers will triage and assign the pull request for review. We appreciate your patience. To safeguard the health of the project, please take a moment to read our code of conduct.

Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

This makes sense to me. Thanks!

@davidmcguiredesign
Copy link
Contributor Author

Thanks Josh! Sorry about the early “resolution”—I’m still new to open-source contribution mechanisms and etiquette.

@Josh-Cena
Copy link
Member

You accepted my suggestion and automatically marked the conversation as resolved—that's exactly how it should go :)

@Josh-Cena Josh-Cena merged commit 39dc22b into mdn:main Oct 18, 2024
5 checks passed
Copy link

Congratulations on your first merged pull request. 🎉 Thank you for your contribution! Did you know we have a project board with high-impact contribution opportunities? We look forward to your next contribution.

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