forked from mirrors/0ad
Rewrite the clone-object-between-JS-contexts code (for GUI<->simulation interface) to be more efficient.
Delete unnecessary unused incomplete profiler scripting support. Clean up some JSAPI code to use newer features. Display simulation script functions in the profiler. This was SVN commit r7503.
This commit is contained in:
@@ -60,7 +60,7 @@ public:
|
||||
void SetCallbackData(void* cbdata);
|
||||
static void* GetCallbackData(JSContext* cx);
|
||||
|
||||
JSContext* GetContext();
|
||||
JSContext* GetContext() const;
|
||||
|
||||
/**
|
||||
* Call a constructor function, roughly equivalent to JS "new ctor".
|
||||
@@ -155,6 +155,14 @@ public:
|
||||
*/
|
||||
bool LoadScript(const std::wstring& filename, const std::wstring& code);
|
||||
|
||||
/**
|
||||
* Construct a new value (usable in this ScriptInterface's context) by cloning
|
||||
* a value from a different context.
|
||||
* Complex values (functions, XML, etc) won't be cloned correctly, but basic
|
||||
* types and cyclic references should be fine.
|
||||
*/
|
||||
jsval CloneValueFromOtherContext(const ScriptInterface& otherContext, jsval val);
|
||||
|
||||
/**
|
||||
* Convert a jsval to a C++ type. (This might trigger GC.)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user