diff options
Diffstat (limited to 'src/couchdb/priv/couch_js')
-rw-r--r-- | src/couchdb/priv/couch_js/http.c | 12 | ||||
-rw-r--r-- | src/couchdb/priv/couch_js/sm185.c | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/couchdb/priv/couch_js/http.c b/src/couchdb/priv/couch_js/http.c index 77078e35..7630c456 100644 --- a/src/couchdb/priv/couch_js/http.c +++ b/src/couchdb/priv/couch_js/http.c @@ -126,7 +126,7 @@ http_open(JSContext* cx, JSObject* req, jsval mth, jsval url, jsval snc) goto done; } - if(mth == JSVAL_VOID) { + if(JSVAL_IS_VOID(mth)) { JS_ReportError(cx, "You must specify a method."); goto done; } @@ -148,7 +148,7 @@ http_open(JSContext* cx, JSObject* req, jsval mth, jsval url, jsval snc) http->method = methid; - if(url == JSVAL_VOID) { + if(JSVAL_IS_VOID(url)) { JS_ReportError(cx, "You must specify a URL."); goto done; } @@ -164,7 +164,7 @@ http_open(JSContext* cx, JSObject* req, jsval mth, jsval url, jsval snc) goto done; } - if(snc != JSVAL_FALSE) { + if(JSVAL_IS_BOOLEAN(snc) && !JSVAL_TO_BOOLEAN(snc)) { JS_ReportError(cx, "Synchronous flag must be false."); goto done; } @@ -200,7 +200,7 @@ http_set_hdr(JSContext* cx, JSObject* req, jsval name, jsval val) goto done; } - if(name == JSVAL_VOID) + if(JSVAL_IS_VOID(name)) { JS_ReportError(cx, "You must speciy a header name."); goto done; @@ -213,7 +213,7 @@ http_set_hdr(JSContext* cx, JSObject* req, jsval name, jsval val) goto done; } - if(val == JSVAL_VOID) + if(JSVAL_IS_VOID(val)) { JS_ReportError(cx, "You must specify a header value."); goto done; @@ -258,7 +258,7 @@ http_send(JSContext* cx, JSObject* req, jsval body) goto done; } - if(body != JSVAL_VOID && body != JS_GetEmptyStringValue(cx)) { + if(!JSVAL_IS_VOID(body)) { bodystr = enc_string(cx, body, &bodylen); if(!bodystr) { JS_ReportError(cx, "Failed to encode body."); diff --git a/src/couchdb/priv/couch_js/sm185.c b/src/couchdb/priv/couch_js/sm185.c index 701d5677..6a4522e7 100644 --- a/src/couchdb/priv/couch_js/sm185.c +++ b/src/couchdb/priv/couch_js/sm185.c @@ -310,7 +310,7 @@ main(int argc, const char* argv[]) JSObject* global = NULL; JSCrossCompartmentCall *call = NULL; JSObject* klass = NULL; - JSObject* script; + JSSCRIPT_TYPE script; JSString* scriptsrc; const jschar* schars; size_t slen; |