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

Extending example module class #9

Closed
VelvetyWhite opened this issue Feb 6, 2020 · 2 comments
Closed

Extending example module class #9

VelvetyWhite opened this issue Feb 6, 2020 · 2 comments

Comments

@VelvetyWhite
Copy link

In you example, you register a C++ class like so:

module.class_<MyClass>("MyClass")
                .constructor<>()
                .constructor<std::vector<int>>("MyClassA")
                .fun<&MyClass::member_variable>("member_variable")
                .fun<&MyClass::member_function>("member_function");

and then you import the module in JS. I tried to extend this class with a small test script

class test extends my.MyClass {
  constructor() {
    super();
    console.log('test.constructor');
   }
};

but i get TypeError: parent prototype must be an object or null.
Is this the expected behavior and I can't extend c++ module registered classes or is it a bug?

Thanks

@ftk
Copy link
Owner

ftk commented Feb 7, 2020

Should be fixed in c5d89b8

@VelvetyWhite
Copy link
Author

Seems to be working just fine now. Thank you

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

No branches or pull requests

2 participants