static JSBool req_set_hdr(JSContext* cx, JSObject* obj, uintN argc, jsval* argv, jsval* rval) { JSBool ret = JS_FALSE; if(argc == 2) { ret = http_set_hdr(cx, obj, argv[0], argv[1]); } else { JS_ReportError(cx, "Invalid call to CouchHTTP.set_header"); } *rval = JSVAL_VOID; return ret; }
static JSBool req_set_hdr(JSContext* cx, uintN argc, jsval* vp) { JSObject* obj = JS_THIS_OBJECT(cx, vp); jsval* argv = JS_ARGV(cx, vp); JSBool ret = JS_FALSE; if(argc == 2) { ret = http_set_hdr(cx, obj, argv[0], argv[1]); } else { JS_ReportError(cx, "Invalid call to CouchHTTP.set_header"); } JS_SET_RVAL(cx, vp, JSVAL_VOID); return ret; }