I am using the latest spidermonkey sources from http://hg.mozilla.org/mozilla-central
spidermonkey is built without any problems (JS_VERSION == 180) which makes me think it is not a spidermonkey bug.
Anyway, while building MongoDB, I encountered this error when generating engine_spidermonkey.o :
—
In file included from scripting/engine_spidermonkey.h:37,
from scripting/engine_spidermonkey.cpp:4:
/Users/runpac/dev/spidermonkey_release/include/js/jsregexp.h:188: error: 'JSSLOT_PRIVATE' was not declared in this scope
/Users/runpac/dev/spidermonkey_release/include/js/jsregexp.h: In function 'void js_ClearRegExpLastIndex(JSObject*)':
/Users/runpac/dev/spidermonkey_release/include/js/jsregexp.h:195: error: invalid use of incomplete type 'struct JSObject'
/Users/runpac/dev/spidermonkey_release/include/js/jspubtd.h:144: error: forward declaration of 'struct JSObject'
—
js/jsregexp.h included from engine_spidermonkey.h is missing a few symbols located in js/jsobj.h
I managed to compile everything with this simple fix:
diff --git a/scripting/engine_spidermonkey.h b/scripting/engine_spidermonkey.h
index 46ac71a..6799b99 100644
— a/scripting/engine_spidermonkey.h
+++ b/scripting/engine_spidermonkey.h
@@ -34,6 +34,7 @@
#include "js/jsapi.h"
#include "js/jsdate.h"
+#include "js/jsobj.h"
#include "js/jsregexp.h"
#endif