Allan,

You are setting internal field count for instances created by the function
not for the function itself.

There is currently no method in the API to set internal field count for the
function itself.

--
Vyacheslav Egorov

On Thu, Dec 23, 2010 at 2:58 PM, Allan Douglas R. de Oliveira <
[email protected]> wrote:

> Hello,
>
> I'm dynamically creating a method/function that will be returned by an
> acessor, but I can't set the internal fields of this new method:
>
>        v8::Handle<v8::FunctionTemplate> method_templ =
> v8::FunctionTemplate::New(COMCreateDynamicMethod);
>        v8::Handle<v8::ObjectTemplate> method_inst = method_templ-
> >InstanceTemplate();
>        method_inst->SetInternalFieldCount(2);
>        v8::Handle<v8::Function> method_ctor = method_templ->GetFunction();
>        method_ctor->SetInternalField(0, v8::External::New(p));
>        method_ctor->SetInternalField(1, v8::External::New(dispid));
>
> The last 2 lines fails with:
>
> #
> # Fatal error in v8::Object::SetInternalField()
> # Writing internal field out of bounds
> #
>
>
> I found the open issue: http://code.google.com/p/v8/issues/detail?id=837,
> which seem to be related, but I still need some way to acomplish this.
>
> Thanks,
> Allan Douglas R. de Oliveira
>
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
>

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to