[tsgen] Fix overriding Embind's ClassHandle clone method.#23132
Open
brendandahl wants to merge 1 commit intoemscripten-core:mainfrom
Open
[tsgen] Fix overriding Embind's ClassHandle clone method.#23132brendandahl wants to merge 1 commit intoemscripten-core:mainfrom
brendandahl wants to merge 1 commit intoemscripten-core:mainfrom
Conversation
The return type of `clone` should actually be `ThisType<this>` to better match what the JS is actually doing. This also makes it possible to override the clone method.
sbc100
reviewed
Dec 12, 2024
| deleteLater(): this; | ||
| isDeleted(): boolean; | ||
| clone(): this; | ||
| clone(): ThisType<this>; |
Collaborator
There was a problem hiding this comment.
What does this expression do/mean?
Collaborator
Author
There was a problem hiding this comment.
IIUC, it's magic marker that changes how the this type is bound using the context it was declared instead of where it was called from. This is a workaround for some g3 conflicts, but I'm actually leaning towards abandoning this PR and asking that they don't try to override the clone method.
Collaborator
There was a problem hiding this comment.
Seems a little magical but LGTM if it fixes the issue!
sbc100
approved these changes
Dec 12, 2024
vrabaud
added a commit
to vrabaud/opencv
that referenced
this pull request
Dec 18, 2024
This is in emscripten 3.1.71 and above, cf emscripten-core/emscripten#22734 There was a temptative fix upstream to no avail: emscripten-core/emscripten#23132
vrabaud
added a commit
to vrabaud/opencv
that referenced
this pull request
Dec 18, 2024
This is in emscripten 3.1.71 and above, cf emscripten-core/emscripten#22734 There was a temptative fix upstream to no avail: emscripten-core/emscripten#23132
6 tasks
shyama7004
pushed a commit
to shyama7004/opencv
that referenced
this pull request
Jan 20, 2025
This is in emscripten 3.1.71 and above, cf emscripten-core/emscripten#22734 There was a temptative fix upstream to no avail: emscripten-core/emscripten#23132
NanQin555
pushed a commit
to NanQin555/opencv
that referenced
this pull request
Feb 24, 2025
This is in emscripten 3.1.71 and above, cf emscripten-core/emscripten#22734 There was a temptative fix upstream to no avail: emscripten-core/emscripten#23132
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The return type of
cloneshould actually beThisType<this>to better match what the JS is actually doing. This also makes it possible to override the clone method.