Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9B6DE72A5 for ; Wed, 26 Oct 2011 18:08:14 +0000 (UTC) Received: (qmail 32325 invoked by uid 500); 26 Oct 2011 18:08:14 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 32284 invoked by uid 500); 26 Oct 2011 18:08:14 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 32170 invoked by uid 99); 26 Oct 2011 18:08:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Oct 2011 18:08:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.114] (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Oct 2011 18:08:12 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B313054469; Wed, 26 Oct 2011 18:05:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kocolosk@apache.org To: commits@couchdb.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [6/50] git commit: Minor fixes to link agianst SpiderMonkey trunk Message-Id: <20111026180532.B313054469@tyr.zones.apache.org> Date: Wed, 26 Oct 2011 18:05:32 +0000 (UTC) Minor fixes to link agianst SpiderMonkey trunk This patch allows couchjs to link against the SpiderMonkey as it existed in the mercurial hash 59c1e6bdb11 from [1]. This does *not* ensure compatibility with CouchDB as there are other things that will also need to be fixed. Specifically, the anonymous function issue for builtin JS functions. [1] http://hg.mozilla.org/mozilla-central/ Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/7c989eca Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/7c989eca Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/7c989eca Branch: refs/heads/1319-large-headers-are-corrupted Commit: 7c989eca403080cac9917ba6701594ace9c24803 Parents: 9ffc1df Author: Paul Joseph Davis Authored: Tue Oct 18 16:19:51 2011 -0500 Committer: Paul Joseph Davis Committed: Tue Oct 18 16:20:51 2011 -0500 ---------------------------------------------------------------------- configure.ac | 8 ++++++++ src/couchdb/priv/couch_js/http.c | 12 ++++++------ src/couchdb/priv/couch_js/sm185.c | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/7c989eca/configure.ac ---------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index c7b9930..f7cf955 100644 --- a/configure.ac +++ b/configure.ac @@ -293,6 +293,14 @@ If you wish to ignore this error pass --enable-js-trunk to ./configure.])], [[#include ]]) fi +# Deal with JSScript -> JSObject -> JSScript switcheroo + +AC_CHECK_TYPE([JSScript*], + [AC_DEFINE([JSSCRIPT_TYPE], [JSScript*], [Use JSObject* for scripts])], + [AC_DEFINE([JSSCRIPT_TYPE], [JSObject*], [Use JSScript* for scripts])], + [[#include ]] +) + CPPFLAGS="$OLD_CPPFLAGS" http://git-wip-us.apache.org/repos/asf/couchdb/blob/7c989eca/src/couchdb/priv/couch_js/http.c ---------------------------------------------------------------------- diff --git a/src/couchdb/priv/couch_js/http.c b/src/couchdb/priv/couch_js/http.c index 7e1e20b..67ba8a1 100644 --- a/src/couchdb/priv/couch_js/http.c +++ b/src/couchdb/priv/couch_js/http.c @@ -181,7 +181,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; } @@ -203,7 +203,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; } @@ -219,7 +219,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; } @@ -255,7 +255,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; @@ -268,7 +268,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; @@ -313,7 +313,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."); http://git-wip-us.apache.org/repos/asf/couchdb/blob/7c989eca/src/couchdb/priv/couch_js/sm185.c ---------------------------------------------------------------------- diff --git a/src/couchdb/priv/couch_js/sm185.c b/src/couchdb/priv/couch_js/sm185.c index 701d567..6a4522e 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;