1
0
forked from mirrors/0ad

Slightly better dictionary handling

This was SVN commit r1041.
This commit is contained in:
Ykkrosh
2004-08-24 11:28:18 +00:00
parent 49b5c5c2b8
commit c6d292dc87
5 changed files with 28 additions and 16 deletions
+6 -1
View File
@@ -149,6 +149,10 @@ static JSClass JSI_class_scriptglobal = {
ScriptObject::ScriptObject(CLocale* locale, JSContext* cx)
: Context(cx)
{
// Don't do much if there's currently no scripting support
if (cx == NULL)
return;
// This should, in theory, never fail
Object = JS_NewObject(Context, &JSI_class_scriptglobal, NULL, NULL);
@@ -172,7 +176,8 @@ ScriptObject::ScriptObject(CLocale* locale, JSContext* cx)
ScriptObject::~ScriptObject()
{
JS_RemoveRoot(Context, &Object);
if (Context)
JS_RemoveRoot(Context, &Object);
}
bool ScriptObject::ExecuteCode(const jschar* data, size_t len, const char* filename)