зеркало из https://github.com/mozilla/pjs.git
No bug - NULL isn't a boolean (JS_InitCTypesClass edition); rs=Waldo
This commit is contained in:
Родитель
a97bbc022d
Коммит
40f6ff712f
|
@ -1173,25 +1173,25 @@ JS_InitCTypesClass(JSContext* cx, JSObject* global)
|
||||||
// Set up ctypes.CDataFinalizer.prototype.
|
// Set up ctypes.CDataFinalizer.prototype.
|
||||||
JSObject* ctor;
|
JSObject* ctor;
|
||||||
if (!GetObjectProperty(cx, ctypes, "CDataFinalizer", &ctor)) {
|
if (!GetObjectProperty(cx, ctypes, "CDataFinalizer", &ctor)) {
|
||||||
return NULL;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSObject* prototype = JS_NewObject(cx, &sCDataFinalizerProtoClass,
|
JSObject* prototype = JS_NewObject(cx, &sCDataFinalizerProtoClass,
|
||||||
NULL, ctypes);
|
NULL, ctypes);
|
||||||
if (!prototype)
|
if (!prototype)
|
||||||
return NULL;
|
return false;
|
||||||
|
|
||||||
if (!JS_DefineProperties(cx, prototype, sCDataFinalizerProps) ||
|
if (!JS_DefineProperties(cx, prototype, sCDataFinalizerProps) ||
|
||||||
!JS_DefineFunctions(cx, prototype, sCDataFinalizerFunctions))
|
!JS_DefineFunctions(cx, prototype, sCDataFinalizerFunctions))
|
||||||
return NULL;
|
return false;
|
||||||
|
|
||||||
if (!JS_DefineProperty(cx, ctor, "prototype", OBJECT_TO_JSVAL(prototype),
|
if (!JS_DefineProperty(cx, ctor, "prototype", OBJECT_TO_JSVAL(prototype),
|
||||||
NULL, NULL, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT))
|
NULL, NULL, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT))
|
||||||
return NULL;
|
return false;
|
||||||
|
|
||||||
if (!JS_DefineProperty(cx, prototype, "constructor", OBJECT_TO_JSVAL(ctor),
|
if (!JS_DefineProperty(cx, prototype, "constructor", OBJECT_TO_JSVAL(ctor),
|
||||||
NULL, NULL, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT))
|
NULL, NULL, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT))
|
||||||
return NULL;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
// Seal the ctypes object, to prevent modification.
|
// Seal the ctypes object, to prevent modification.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче