[quickjs-devel] Re: Create a new instance of the class using name

  • From: Ondřej Jirman <deibeemoocheuguhumoh@xxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Sat, 25 Jan 2020 13:11:39 +0100

On Sat, Jan 25, 2020 at 03:31:39PM +0530, JM wrote:

Since I didn't receive any answer, I assume there is no CAPI to do this. Is
it a correct assumption?

You need to do it in more steps:

1) get global object
2) get property named 'YourClass'
3) create an instance by calling JS_CallConstructor on reference to YourClass
   from 2)

        o.



On Thu, Jan 23, 2020 at 4:37 PM JM <jeevhi@xxxxxxxxx> wrote:

How to create an instance of a class using the class name (and not the
class id). I couldn't find any function to achieve this.

Can someone point me to the right function?






Other related posts: