Re: [v8-users] How to set internal field on a Local

2019-03-19 Thread Darin Dimitrov
Thanks Ben! Yes, I am aware of this but actually I need to retrieve this external data *before* creating an instance using the function. Here's an example: var myFunc = MyCustomFunction; // Here MyCustomFunction is an instance of Local that I have registered on the global object

Re: [v8-users] How to set internal field on a Local

2019-03-19 Thread Ben Noordhuis
On Tue, Mar 19, 2019 at 9:41 AM Darin Dimitrov wrote: > > I am trying to associate an internal field with a Local created > from a Local: > > Local ctorFuncTemplate = FunctionTemplate::New(isolate); > > Local ctorFunc = > ctorFuncTemplate->GetFunction(context).ToLocalChecked(); > >

[v8-users] How to set internal field on a Local

2019-03-19 Thread Darin Dimitrov
I am trying to associate an internal field with a Local created from a Local: Local ctorFuncTemplate = FunctionTemplate::New(isolate); Local ctorFunc = ctorFuncTemplate->GetFunction(context).ToLocalChecked(); ctorFunc->SetInternalField(0, External::New(isolate, ptr)); This fails with