diff options
-rw-r--r-- | src/couch/rebar.config.script | 15 | ||||
-rw-r--r-- | src/couch/test/eunit/couch_js_tests.erl | 3 | ||||
-rw-r--r-- | support/build_js.escript | 14 |
3 files changed, 17 insertions, 15 deletions
diff --git a/src/couch/rebar.config.script b/src/couch/rebar.config.script index 5c9e6335f..a6d700518 100644 --- a/src/couch/rebar.config.script +++ b/src/couch/rebar.config.script @@ -61,6 +61,8 @@ SMVsn = case lists:keyfind(spidermonkey_version, 1, CouchConfig) of "60"; {_, "68"} -> "68"; + {_, "78"} -> + "78"; {_, "86"} -> "86"; undefined -> @@ -84,7 +86,12 @@ ConfigH = [ {"PACKAGE_VERSION", "\"" ++ Version ++ "\""} ]. -CouchJSConfig = "priv/couch_js/" ++ SMVsn ++ "/config.h". +CouchJSConfig = case SMVsn of + "78" -> + "priv/couch_js/86/config.h"; + _ -> + "priv/couch_js/" ++ SMVsn ++ "/config.h" +end. ConfigSrc = [["#define ", K, " ", V, $\n] || {K, V} <- ConfigH]. ConfigBin = iolist_to_binary(ConfigSrc). ok = CopyIfDifferent(CouchJSConfig, ConfigBin). @@ -132,6 +139,11 @@ end. "-DXP_UNIX -I/usr/include/mozjs-68 -I/usr/local/include/mozjs-68 -std=c++14 -Wno-invalid-offsetof", "-L/usr/local/lib -std=c++14 -lmozjs-68 -lm" }; + {unix, _} when SMVsn == "78" -> + { + "-DXP_UNIX -I/usr/include/mozjs-78 -I/usr/local/include/mozjs-78 -std=c++20 -Wno-invalid-offsetof", + "-L/usr/local/lib -std=c++20 -lmozjs-78 -lm" + }; {unix, _} when SMVsn == "86" -> { "-DXP_UNIX -I/usr/include/mozjs-86 -I/usr/local/include/mozjs-86 -I/opt/homebrew/include/mozjs-86/ -std=c++17 -Wno-invalid-offsetof", @@ -143,6 +155,7 @@ CouchJSSrc = case SMVsn of "1.8.5" -> ["priv/couch_js/1.8.5/*.c"]; "60" -> ["priv/couch_js/60/*.cpp"]; "68" -> ["priv/couch_js/68/*.cpp"]; + "78" -> ["priv/couch_js/86/*.cpp"]; "86" -> ["priv/couch_js/86/*.cpp"] end. diff --git a/src/couch/test/eunit/couch_js_tests.erl b/src/couch/test/eunit/couch_js_tests.erl index 693cd9772..c68d60125 100644 --- a/src/couch/test/eunit/couch_js_tests.erl +++ b/src/couch/test/eunit/couch_js_tests.erl @@ -150,8 +150,9 @@ should_exit_on_oom() -> "var state = [];\n" "function(doc) {\n" " var val = \"0123456789ABCDEF\";\n" - " for(var i = 0; i < 165535; i++) {\n" + " for(var i = 0; i < 665535; i++) {\n" " state.push([val, val]);\n" + " emit(null, null);\n" " }\n" "}\n" >>, diff --git a/support/build_js.escript b/support/build_js.escript index 03d45a7e5..5f1e92015 100644 --- a/support/build_js.escript +++ b/support/build_js.escript @@ -65,19 +65,7 @@ main([]) -> [ "share/server/rewrite_fun.js" ]; - "60" -> - [ - "share/server/60/esprima.js", - "share/server/60/escodegen.js", - "share/server/60/rewrite_fun.js" - ]; - "68" -> - [ - "share/server/60/esprima.js", - "share/server/60/escodegen.js", - "share/server/60/rewrite_fun.js" - ]; - "86" -> + _ -> [ "share/server/60/esprima.js", "share/server/60/escodegen.js", |