Bug 456284 - JSExtendedClass requires an equality hook. r=crowder, a191=beltzner.

This commit is contained in:
Blake Kaplan
2008-11-28 11:06:30 +01:00
parent 4ed7bbd904
commit 3a4cac883d
2 changed files with 29 additions and 1 deletions

View File

@@ -2591,6 +2591,10 @@ js_NewObjectWithGivenProto(JSContext *cx, JSClass *clasp, JSObject *proto,
objectSize = sizeof(JSObject);
}
/* Assert that the class is a proper class. */
JS_ASSERT_IF(clasp->flags & JSCLASS_IS_EXTENDED,
((JSExtendedClass *)clasp)->equality);
/*
* Allocate an object from the GC heap and initialize all its fields before
* doing any operation that can potentially trigger GC.