Skip to content

Commit 5c8e882

Browse files
authored
Merge pull request #2345 from apache/sm60-davisp
port to spidermonkey 60
2 parents cef0fa0 + ec416c3 commit 5c8e882

33 files changed

+9014
-56
lines changed

.gitignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,11 @@ src/b64url/
3535
src/bear/
3636
src/certifi/
3737
src/config/
38-
src/couch/priv/couch_js/config.h
38+
src/couch/priv/couch_js/**/config.h
3939
src/couch/priv/couchjs
4040
src/couch/priv/couchspawnkillable
4141
src/couch/priv/couch_ejson_compare/couch_ejson_compare.d
42-
src/couch/priv/couch_js/http.d
43-
src/couch/priv/couch_js/main.d
44-
src/couch/priv/couch_js/utf8.d
45-
src/couch/priv/couch_js/util.d
42+
src/couch/priv/couch_js/**/*.d
4643
src/couch/priv/icu_driver/couch_icu_driver.d
4744
src/mango/src/mango_cursor_text.nocompile
4845
src/docs/

LICENSE

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,61 @@ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
850850
OTHER DEALINGS IN THE FONT SOFTWARE.
851851

852852

853+
for share/server/60/esprima.js
854+
Based on https://github.com/jquery/esprima
855+
856+
BSD License
857+
858+
Copyright JS Foundation and other contributors, https://js.foundation/
859+
860+
Redistribution and use in source and binary forms, with or without
861+
modification, are permitted provided that the following conditions are met:
862+
863+
* Redistributions of source code must retain the above copyright
864+
notice, this list of conditions and the following disclaimer.
865+
* Redistributions in binary form must reproduce the above copyright
866+
notice, this list of conditions and the following disclaimer in the
867+
documentation and/or other materials provided with the distribution.
868+
869+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
870+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
871+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
872+
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
873+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
874+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
875+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
876+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
877+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
878+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
879+
880+
881+
882+
share/server/60/escodegen.js
883+
Based on https://github.com/estools/escodegen
884+
885+
BSD License
886+
887+
Redistribution and use in source and binary forms, with or without
888+
modification, are permitted provided that the following conditions are met:
889+
890+
* Redistributions of source code must retain the above copyright
891+
notice, this list of conditions and the following disclaimer.
892+
* Redistributions in binary form must reproduce the above copyright
893+
notice, this list of conditions and the following disclaimer in the
894+
documentation and/or other materials provided with the distribution.
895+
896+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
897+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
898+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
899+
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
900+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
901+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
902+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
903+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
904+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
905+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
906+
907+
853908
for src/fauxton/assets/less/bootstrap/font-awesome/*
854909
for share/www/css/*
855910

NOTICE

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ This product also includes the following third-party components:
178178

179179
Copyright (c) 2015 Twitter, Inc.
180180

181+
* esprima.js (https://github.com/jquery/esprima)
182+
183+
Copyright JS Foundation and other contributors, https://js.foundation/
184+
185+
* escodegen.js (https://github.com/estools/escodegen)
186+
187+
Copyright (C) 2012 Yusuke Suzuki (twitter: @Constellation) and other contributors.
188+
181189
* hyper
182190

183191
Copyright (c) 2014 Game Analytics ApS

configure

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ ERLANG_MD5="false"
3030
SKIP_DEPS=0
3131

3232
COUCHDB_USER="$(whoami 2>/dev/null || echo couchdb)"
33+
SM_VSN="1.8.5"
3334

3435
. ${rootdir}/version.mk
3536
COUCHDB_VERSION=${vsn_major}.${vsn_minor}.${vsn_patch}
@@ -50,6 +51,7 @@ Options:
5051
--disable-docs do not build any documentation or manpages
5152
--erlang-md5 use erlang for md5 hash operations
5253
--dev alias for --with-curl --disable-docs --disable-fauxton
54+
--spidermonkey-version VSN specify the version of SpiderMonkey to use (defaults to $SM_VSN)
5355
--skip-deps do not update erlang dependencies
5456
--rebar=PATH use rebar by specified path (version >=2.6.0 && <3.0 required)
5557
EOF
@@ -140,6 +142,24 @@ parse_opts() {
140142
printf 'ERROR: "--user" requires a non-empty argument.\n' >&2
141143
exit 1
142144
;;
145+
146+
--spidermonkey-version)
147+
if [ -n "$2" ]; then
148+
eval SM_VSN=$2
149+
shift 2
150+
continue
151+
else
152+
printf 'ERROR: "--spidermonkey-version" requires a non-empty argument.\n' >&2
153+
exit 1
154+
fi
155+
;;
156+
--spidermonkey-version=?*)
157+
eval SM_VSN=${1#*=}
158+
;;
159+
--spidermonkey-version=)
160+
printf 'ERROR: "--spidermonkey-version" requires a non-empty argument.\n' >&2
161+
exit 1
162+
;;
143163
--) # End of options
144164
shift
145165
break
@@ -180,6 +200,7 @@ cat > rel/couchdb.config << EOF
180200
{log_file, "$LOG_FILE"}.
181201
{fauxton_root, "./share/www"}.
182202
{user, "$COUCHDB_USER"}.
203+
{spidermonkey_version, "$SM_VSN"}.
183204
{node_name, "-name [email protected]"}.
184205
{cluster_port, 5984}.
185206
{backend_port, 5986}.
@@ -206,12 +227,14 @@ with_fauxton = $WITH_FAUXTON
206227
with_docs = $WITH_DOCS
207228
208229
user = $COUCHDB_USER
230+
spidermonkey_version = $SM_VSN
209231
EOF
210232

211233
cat > $rootdir/config.erl << EOF
212234
{with_curl, $WITH_CURL}.
213235
{with_proper, $WITH_PROPER}.
214236
{erlang_md5, $ERLANG_MD5}.
237+
{spidermonkey_version, "$SM_VSN"}.
215238
EOF
216239

217240
install_local_rebar() {

configure.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
-DisableDocs request build process skip building documentation (default false)
1111
-SkipDeps do not update Erlang dependencies (default false)
1212
-CouchDBUser USER set the username to run as (defaults to current user)
13+
-SpiderMonkeyVersion VSN select the version of SpiderMonkey to use (defaults to 1.8.5)
1314
1415
Installation directories:
1516
-Prefix PREFIX install architecture-independent files in PREFIX
@@ -49,6 +50,8 @@ Param(
4950
[ValidateNotNullOrEmpty()]
5051
[string]$CouchDBUser = [Environment]::UserName, # set the username to run as (defaults to current user)
5152
[ValidateNotNullOrEmpty()]
53+
[string]$SpiderMonkeyVersion = "1.8.5", # select the version of SpiderMonkey to use (default 1.8.5)
54+
[ValidateNotNullOrEmpty()]
5255
[string]$Prefix = "C:\Program Files\Apache\CouchDB", # install architecture-independent file location (default C:\Program Files\Apache\CouchDB)
5356
[ValidateNotNullOrEmpty()]
5457
[string]$ExecPrefix = $Prefix, # install architecture-dependent file location (default C:\Program Files\Apache\CouchDB)
@@ -133,6 +136,7 @@ $CouchDBConfig = @"
133136
{log_file, ""}.
134137
{fauxton_root, "./share/www"}.
135138
{user, "$CouchDBUser"}.
139+
{spidermonkey_version, "$SpiderMonkeyVersion"}.
136140
{node_name, "-name couchdb@localhost"}.
137141
{cluster_port, 5984}.
138142
{backend_port, 5986}.
@@ -144,7 +148,7 @@ $InstallMk = @"
144148
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
145149
# use this file except in compliance with the License. You may obtain a copy of
146150
# the License at
147-
#
151+
#
148152
# http://www.apache.org/licenses/LICENSE-2.0
149153
#
150154
# Unless required by applicable law or agreed to in writing, software
@@ -175,12 +179,14 @@ with_fauxton = $BuildFauxton
175179
with_docs = $BuildDocs
176180
177181
user = $CouchDBUser
182+
spidermonkey_version = $SpiderMonkeyVersion
178183
"@
179184
$InstallMk | Out-File "$rootdir\install.mk" -encoding ascii
180185

181186
$lowercurl = "$WithCurl".ToLower()
182187
$ConfigERL = @"
183188
{with_curl, $lowercurl}.
189+
{spidermonkey_version, "$SpiderMonkeyVersion"}.
184190
"@
185191
$ConfigERL | Out-File "$rootdir\config.erl" -encoding ascii
186192

share/server/60/escodegen.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)