Bug 599672 - Give the regexp statics a parent. r=cdleary

This commit is contained in:
Blake Kaplan 2010-10-21 13:51:56 -07:00
parent 7e549c90ad
commit 0080dbcfa1
2 changed files with 3 additions and 3 deletions

View File

@ -3000,7 +3000,7 @@ JS_NewGlobalObject(JSContext *cx, JSClass *clasp)
return NULL;
/* Construct a regexp statics object for this global object. */
JSObject *res = regexp_statics_construct(cx);
JSObject *res = regexp_statics_construct(cx, obj);
if (!res ||
!js_SetReservedSlot(cx, obj, JSRESERVED_GLOBAL_REGEXP_STATICS,
ObjectValue(*res))) {

View File

@ -60,9 +60,9 @@ namespace js {
extern Class regexp_statics_class;
static inline JSObject *
regexp_statics_construct(JSContext *cx)
regexp_statics_construct(JSContext *cx, JSObject *parent)
{
JSObject *obj = NewObject<WithProto::Given>(cx, &regexp_statics_class, NULL, NULL);
JSObject *obj = NewObject<WithProto::Given>(cx, &regexp_statics_class, NULL, parent);
if (!obj)
return NULL;
RegExpStatics *res = cx->create<RegExpStatics>();