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

refactor: don't call update() multiple times in the prototype chain #91

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

TTtie
Copy link
Member

@TTtie TTtie commented Jul 26, 2023

The update() method is already called in the base class - according to JS class semantics, when calling a constructor via super, this still points to the object at the top of the prototype chain, resulting in the update() method being called twice or more down the prototype chain as the super-classes initialize.

The update() method is already called in the base class
- according to JS class semantics, when calling a constructor via `super`,
`this` still points to the object at the top of the prototype chain,
resulting in the update() method called twice or more.
@TTtie TTtie added type: enhancement New feature or request scope: structures Issues or pull requests affecting the structure definitions labels Jul 26, 2023
@TTtie TTtie added this to the 0.2.0 milestone Jul 26, 2023
@TTtie TTtie merged commit aed9023 into dev Jul 27, 2023
2 checks passed
@TTtie TTtie deleted the refactor/call-update-only-once branch July 27, 2023 22:56
TTtie added a commit that referenced this pull request Jul 27, 2023
)

The update() method is already called in the base class - according to JS class semantics, when calling a constructor via `super`, `this` still points to the object at the top of the prototype chain, resulting in the update() method being called twice or more down the prototype chain as the super-classes initialize.
TTtie added a commit that referenced this pull request Aug 10, 2023
)

The update() method is already called in the base class - according to JS class semantics, when calling a constructor via `super`, `this` still points to the object at the top of the prototype chain, resulting in the update() method being called twice or more down the prototype chain as the super-classes initialize.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: structures Issues or pull requests affecting the structure definitions type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant