apache / couchdb

Seamless multi-master syncing database with an intuitive HTTP/JSON API, designed for reliability
https://couchdb.apache.org/
Apache License 2.0
6.28k stars 1.03k forks source link

Simplify SpiderMonkey couchjs sources #5321

Open big-r81 opened 1 month ago

big-r81 commented 1 month ago

Hi,

I tried to combine and merge the different SpiderMonkey source files together.

During compiling with SM v128 I got the following error message:

[1] Compiling /Users/big-r/Documents/Developer/CouchDB/couchdb/src/couch/priv/couch_js/102/util.cpp
/Users/big-r/Documents/Developer/CouchDB/couchdb/src/couch/priv/couch_js/102/util.cpp:327:17: error: invalid operands to binary expression ('std::ostringstream' (aka 'basic_ostringstream<char>') and 'JS::ConstUTF8CharsZ')
            msg << report->filename;
            ~~~ ^  ~~~~~~~~~~~~~~~~

[2] /Users/big-r/Documents/Developer/CouchDB/couchdb/src/couch/priv/couch_js/102/util.cpp:333:49: error: invalid operands to binary expression ('basic_ostream<char, char_traits<char>>' and 'JS::ColumnNumberOneOrigin')
            msg << ':' << report->lineno << ':' << report->column;
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~

I fixed these both errors with the following statements:

[1] msg << report->filename.c_str();

[2] msg << ':' << report->lineno << ':' << report->column.oneOriginValue();

After that change, I successful compiled against v91, v115 and v128 und run the Fauxton checks! It seems, that the missing part in all version was the deepFreeze function...

Here is the full log: error.log

janl commented 1 day ago

@big-r81 any objections to merging this to unblock development on macOS and fixing windows at a later stage?

big-r81 commented 1 day ago

Theoretically yes, the question is, if my “fixes” of the above messages are correct (searching for someone with more c/c++ knowledge).