bug 724310 - drop cx argument from JSObject field and fixed slots infallible API. r=:Waldo

This commit is contained in:
Igor Bukanov
2012-02-05 21:07:23 +01:00
parent 5df21bd1f7
commit 6fefb1df81
64 changed files with 1000 additions and 1310 deletions

View File

@@ -825,7 +825,7 @@ Parent(JSContext *cx, uintN argc, jsval *vp)
return false;
}
*vp = OBJECT_TO_JSVAL(JS_GetParent(cx, JSVAL_TO_OBJECT(v)));
*vp = OBJECT_TO_JSVAL(JS_GetParent(JSVAL_TO_OBJECT(v)));
return true;
}
@@ -923,7 +923,7 @@ env_enumerate(JSContext *cx, JSObject *obj)
if (reflected)
return true;
for (evp = (char **)JS_GetPrivate(cx, obj); (name = *evp) != NULL; evp++) {
for (evp = (char **)JS_GetPrivate(obj); (name = *evp) != NULL; evp++) {
value = strchr(name, '=');
if (!value)
continue;
@@ -1234,7 +1234,7 @@ ProcessArgs(JSContext *cx, JSObject *obj, char **argv, int argc)
xpc_ActivateDebugMode();
break;
case 'P':
if (JS_GetClass(JS_GetPrototype(cx, obj)) != &global_class) {
if (JS_GetClass(JS_GetPrototype(obj)) != &global_class) {
JSObject *gobj;
if (!JS_DeepFreezeObject(cx, obj))
@@ -1977,11 +1977,13 @@ main(int argc, char **argv, char **envp)
}
envobj = JS_DefineObject(cx, glob, "environment", &env_class, NULL, 0);
if (!envobj || !JS_SetPrivate(cx, envobj, envp)) {
if (!envobj) {
JS_EndRequest(cx);
return 1;
}
JS_SetPrivate(envobj, envp);
nsAutoString workingDirectory;
if (GetCurrentWorkingDirectory(workingDirectory))
gWorkingDirectory = &workingDirectory;