Bug 599672 - Give the regexp statics a parent. r=cdleary
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 21 Oct 2010 13:51:56 -0700
changeset 56553 e04e150cf0a68aec745c9b048b7ff22bc9e8d05f
parent 56552 99907cb0d9ced9e998507f26196f5931cf3b2b32
child 56554 70caa8e863bcd5c19dbacbfbf3bc0a4ed53731fc
push id16602
push userrsayre@mozilla.com
push dateWed, 27 Oct 2010 01:10:03 +0000
treeherdermozilla-central@7b83033bb6f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscdleary
bugs599672
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 599672 - Give the regexp statics a parent. r=cdleary
js/src/jsapi.cpp
js/src/jsregexpinlines.h
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -2995,17 +2995,17 @@ JS_NewGlobalObject(JSContext *cx, JSClas
     JS_THREADSAFE_ASSERT(cx->compartment != cx->runtime->defaultCompartment);
     CHECK_REQUEST(cx);
     JS_ASSERT(clasp->flags & JSCLASS_IS_GLOBAL);
     JSObject *obj = NewNonFunction<WithProto::Given>(cx, Valueify(clasp), NULL, NULL);
     if (!obj)
         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))) {
         return NULL;
     }
 
     return obj;
 }
--- a/js/src/jsregexpinlines.h
+++ b/js/src/jsregexpinlines.h
@@ -55,19 +55,19 @@ namespace js {
 
 /*
  * res = RegExp statics.
  */
 
 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>();
     if (!res)
         return NULL;
     obj->setPrivate(static_cast<void *>(res));
     return obj;
 }