} else if (JSVAL_IS_PRIMITIVE(argv[0])) {  tmp = js_ValueToNonNullObject(cx, argv[0]); if (!tmp) return JS_FALSE; argv[0] = OBJECT_TO_JSVAL(tmp);
JS_STATIC_DLL_CALLBACK(JSBool)js_generic_native_method_dispatcher(JSContext *cx, JSObject *obj,                                    uintN argc, jsval *argv, jsval *rval){    jsval fsv;    JSFunctionSpec *fs;    JSObject *tmp;    if (!JS_GetReservedSlot(cx, JSVAL_TO_OBJECT(argv[-2]), 0, &fsv))        return JS_FALSE;    fs = (JSFunctionSpec *) JSVAL_TO_PRIVATE(fsv);    if (argc == 0) {        /*         * Follow Function.prototype.apply and .call by using the global         * object as the 'this' param if no args.  We know argv[0] is valid         * because JS_DefineFunctions, below, defined us as requiring at         * least one argument (it passes fs->nargs + 1 as the penultimate         * argument to JS_DefineFunction).         */        while ((tmp = OBJ_GET_PARENT(cx, obj)) != NULL)            obj = tmp;        argv[0] = OBJECT_TO_JSVAL(obj);        argc = 1;    }    /*     * Copy all actual (argc) and required but missing (fs->nargs + 1 - argc)     * args down over our |this| parameter, argv[-1], which is almost always     * the class constructor object, e.g. Array.  Then call the corresponding     * prototype native method with our first argument passed as |this|.     */    memmove(argv - 1, argv, (fs->nargs + 1) * sizeof(jsval));    return fs->call(cx, JSVAL_TO_OBJECT(argv[-1]), argc - 1, argv, rval);}