ftk / quickjspp

QuickJS C++ wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extending example module class

VelvetyWhite opened this issue · comments

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

commented

Should be fixed in c5d89b8

commented

Seems to be working just fine now. Thank you