forked from Studio3T/robomongo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathengine_spidermonkey-h.diff
55 lines (46 loc) · 1.44 KB
/
engine_spidermonkey-h.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--- libs/mongo/src/mongo/scripting/engine_spidermonkey.h 2013-02-17 22:13:19.100668823 +0300
+++ dev/robomongo/include/mongo/scripting/engine_spidermonkey.h 2012-12-06 00:35:01.722024190 +0300
@@ -19,20 +19,34 @@
#include "mongo/scripting/engine.h"
// START inc hacking
#ifdef WIN32
+#ifdef ROBOMONGO
+#include "js/jstypes.h"
+#else
#include <third_party/js-1.7/jstypes.h>
+#endif
#undef JS_PUBLIC_API
#undef JS_PUBLIC_DATA
#define JS_PUBLIC_API(t) t __cdecl
#define JS_PUBLIC_DATA(t) t
#endif
+#ifdef ROBOMONGO
+#include "js/jsapi.h"
+#else
#include <third_party/js-1.7/jsapi.h>
+#endif
+
+#ifdef ROBOMONGO
+extern std::vector<mongo::BSONObj> __objects;
+extern std::stringstream __logs;
+
+#endif
// END inc hacking
// -- SM 1.6 hacks ---
#ifndef JSCLASS_GLOBAL_FLAGS
#error old version of spider monkey ( probably 1.6 ) you should upgrade to at least 1.7
@@ -63,13 +77,17 @@
extern JSClass numberlong_class;
extern JSClass numberint_class;
extern JSClass minkey_class;
extern JSClass maxkey_class;
// internal things
+ #ifdef ROBOMONGO
+ void dontDeleteScope( SMScope * s );
+ #else
void dontDeleteScope( SMScope * s ) {}
+ #endif
void errorReporter( JSContext *cx, const char *message, JSErrorReport *report );
extern boost::thread_specific_ptr<SMScope> currentScope;
// bson
JSBool resolveBSONField( JSContext *cx, JSObject *obj, jsval id, uintN flags, JSObject **objp );