Skip to content

[embind] Support policies in allow_subclass#26307

Merged
brendandahl merged 1 commit intoemscripten-core:mainfrom
brendandahl:embind-subclass-pointer
Feb 20, 2026
Merged

[embind] Support policies in allow_subclass#26307
brendandahl merged 1 commit intoemscripten-core:mainfrom
brendandahl:embind-subclass-pointer

Conversation

@brendandahl
Copy link
Collaborator

Add support for passing policies to the allow_subclass method in embind. This allows the use of constructors that require policies, such as those taking raw pointers, when enabling C++ subclassing from JavaScript.

Previously, allow_subclass only accepted a constructor argument, making it impossible to use policies like allow_raw_pointer with the generated 'implement' method.

Fixes #26270

Add support for passing policies to the allow_subclass method in
embind. This allows the use of constructors that require policies,
such as those taking raw pointers, when enabling C++ subclassing
from JavaScript.

Previously, allow_subclass only accepted a constructor argument,
making it impossible to use policies like allow_raw_pointer with the
generated 'implement' method.
@brendandahl brendandahl merged commit 2e79822 into emscripten-core:main Feb 20, 2026
34 of 36 checks passed
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.

allow_subclass won't let me pass a pointer to the superclass constructor in emscripten 4.0.22

2 participants

Comments