'SpiderMonkey 1.8.5 JS::CallArgsFromVp

When I'm working with Native calls at JavaScript engine SpiderMonkey 1.8.5 I've found in documentation such example:

static bool
 Func(JSContext* cx, unsigned argc, JS::Value* vp)
 {
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
 }

but it from SpiderMonkey 17. In SP 1.8.5 I have CallArgs, but have no CallArgsFromVp(), and it is not clear how to convert JS::Value* to JS::CallArgs.
Is there some analogue \ prototype for CallArgsFromVp in SP 1.8.5?
How to use such Native logic with SP 1.8.5?



Solution 1:[1]

In SP 1.8.5 JS_CALLEE, JS_THIS macros must be used instead.
In my case it looks like:

static bool
 Func(JSContext* cx, unsigned argc, jsval *vp)
 {
    JSObject *obj = JS_THIS_OBJECT(cx, vp);
 }


Who is awesome? I'm awesome!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 JohnDoe