-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
classbinding for classes with multiple inheritance #62
Comments
Cast pointers to class member (variable, function, property getter/setter) to the real class type in addition to 4974a8b Added constructors and copy-constructors for `property_` template in order to use them in `class_::set()` for casting to the real class type. Added tests for binding classes with multiple inheritance.
Cast pointers to class member (variable, function, property getter/setter) to the real class type in addition to 4974a8b Added constructors and copy-constructors for `property_` template in order to use them in `class_::set()` for casting to the real class type. Added tests for binding classes with multiple inheritance.
Hi @padjon, Thank you for the bug reporting! I hope I have fixed it, please pull the master branch to check the fix. |
Hi @pmed, I noticed, it still doesn't work if you use .inherit instead of set. |
Hi @padjon Could you please elaborate this `v8pp::class_::inherit()' issue? Because I can't reproduce it. |
Hi @pmed, sure
Will work, with |
Supply actual registry type to `object_registry::find_object()` on unwrapping in order to cast the result object.
Hi @padjon Thank you so much for the report and test code, it helped a lot! I fixed another bug with casting object pointers from derived to base classes. It seems that multiple inheritance is quite rarely used. Please pull the master branch to check this fix. |
If an object inherits from multiple classes, and the defined method mapping is not part of the first declared inheritance, this leads to accessing the wrong address.
for example:
class CInheriting: public Class1, public Class2 {};
v8pp::class_ CInheriting_class(isolate);
CInheriting_class
.set("Class1Method", &Class1Method) << Works
.set("Class2Method", &Class2Method) << Fails
Tried in VS2017
The text was updated successfully, but these errors were encountered: