Re: How to check if a custom class has a private object set?

Till Schneidereit <[email protected]> Fri, 16 Dec 2016 13:38:19 +0100
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <CACRHVk_ZTYxKtTFShZrGyCAK0ZWLTzDEVh-BeLOm+2+gT0yC_Q@mail.gmail.com>
Are you talking about static functions in JS, i.e. methods called on the
constructor? If so, are you trying to use JS_GetPrivate on the function's
receiver (i.e., `this` value)? That'd be the constructor function, not an
instance of your custom class.

If that's not it, then it'd help to get a more complete example of what
you're trying to do.

On Fri, Dec 16, 2016 at 1:16 PM, Mihai Dobrescu <[email protected]>
wrote:

> I don't get it.
> I have defined it as such.
> The class has two kinds of functions, instance functions and static
> functions.
>
> Instance functions work fine.
>
> Only in case of static functions call it throws that assertion failure.
>
> Why is that? Does it ignore JSCLASS_HAS_PRIVATE when static functions are
> called somehow?
> _______________________________________________
> dev-tech-js-engine mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-tech-js-engine
>