bug 580128 - Define Error constructor in the sealed global for CTypes. r=jst/mrbkap/gal

This commit is contained in:
Peter Van der Beken 2010-10-10 15:47:12 -07:00
parent 9179a39396
commit 61df9ba9bc

View File

@ -123,11 +123,13 @@ InitAndSealCTypesClass(JSContext* cx, JSObject* global)
!JS_SetCTypesCallbacks(cx, JSVAL_TO_OBJECT(ctypes), &sCallbacks))
return false;
// Seal up Object, Function, and Array and their prototypes. (This single
// object instance is shared amongst everyone who imports the ctypes module.)
// Seal up Object, Function, Array and Error and their prototypes. (This
// single object instance is shared amongst everyone who imports the ctypes
// module.)
if (!SealObjectAndPrototype(cx, global, "Object") ||
!SealObjectAndPrototype(cx, global, "Function") ||
!SealObjectAndPrototype(cx, global, "Array"))
!SealObjectAndPrototype(cx, global, "Array") ||
!SealObjectAndPrototype(cx, global, "Error"))
return false;
// Finally, seal the global object, for good measure. (But not recursively;