couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [1/2] git commit: Minor fixes to link agianst SpiderMonkey trunk
Date Tue, 18 Oct 2011 21:36:20 GMT
Updated Branches:
  refs/heads/1.1.x 1e1d07a91 -> 7c6e5f0f4


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/7c6e5f0f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/7c6e5f0f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/7c6e5f0f

Branch: refs/heads/1.1.x
Commit: 7c6e5f0f4340e997a761ff5ca627422fea90d4cc
Parents: 7ce9e10
Author: Paul Joseph Davis <davisp@apache.org>
Authored: Tue Oct 18 16:19:51 2011 -0500
Committer: Paul Joseph Davis <davisp@apache.org>
Committed: Tue Oct 18 16:34:33 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/7c6e5f0f/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 6f9327d..182e0eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -214,6 +214,14 @@ AC_CHECK_LIB([$JS_LIB_BASE], [JS_GetStringCharsAndLength],
     AC_DEFINE([HAVE_JS_GET_STRING_CHARS_AND_LENGTH], [1],
         [Use newer JS_GetCharsAndLength function.]))
 
+# 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 <jsapi.h>]]
+)
+
 AC_LANG_POP(C)
 
 AC_ARG_WITH([win32-icu-binaries], [AC_HELP_STRING([--with-win32-icu-binaries=PATH],

http://git-wip-us.apache.org/repos/asf/couchdb/blob/7c6e5f0f/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 77078e3..7630c45 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.");

http://git-wip-us.apache.org/repos/asf/couchdb/blob/7c6e5f0f/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;


Mime
View raw message