Bug 959012 - When resolving iterator classes, use JSProto_Iterator instead of JSProto_GeneratorFunction. r=luke
authorBobby Holley <bobbyholley@gmail.com>
Thu, 30 Jan 2014 07:45:15 -0800
changeset 181988 926eec8d0540b342d88a3abfa2ed8530f22ca28b
parent 181987 615eb1c448df0a30ac8e56bfecf2fe6e1ec9b023
child 181989 9e35c9af6285ab6c474091992133ab75fc22bf79
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs959012
milestone29.0a1
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 959012 - When resolving iterator classes, use JSProto_Iterator instead of JSProto_GeneratorFunction. r=luke The former triggers all of the appropriate initialization, whereas the latter is 'imaginary' in jsprototypes.h, which means that the is no initialization function associated with it.
js/src/jsworkers.cpp
--- a/js/src/jsworkers.cpp
+++ b/js/src/jsworkers.cpp
@@ -279,26 +279,26 @@ js::StartOffThreadParseScript(JSContext 
     RootedObject obj(cx);
 
     // Initialize all classes needed for parsing while we are still on the main
     // thread. Do this for both the target and the new global so that prototype
     // pointers can be changed infallibly after parsing finishes.
     if (!js_GetClassObject(cx, cx->global(), JSProto_Function, &obj) ||
         !js_GetClassObject(cx, cx->global(), JSProto_Array, &obj) ||
         !js_GetClassObject(cx, cx->global(), JSProto_RegExp, &obj) ||
-        !js_GetClassObject(cx, cx->global(), JSProto_GeneratorFunction, &obj))
+        !js_GetClassObject(cx, cx->global(), JSProto_Iterator, &obj))
     {
         return false;
     }
     {
         AutoCompartment ac(cx, global);
         if (!js_GetClassObject(cx, global, JSProto_Function, &obj) ||
             !js_GetClassObject(cx, global, JSProto_Array, &obj) ||
             !js_GetClassObject(cx, global, JSProto_RegExp, &obj) ||
-            !js_GetClassObject(cx, global, JSProto_GeneratorFunction, &obj))
+            !js_GetClassObject(cx, global, JSProto_Iterator, &obj))
         {
             return false;
         }
     }
 
     ScopedJSDeletePtr<ExclusiveContext> workercx(
         cx->new_<ExclusiveContext>(cx->runtime(), (PerThreadData *) nullptr,
                                    ThreadSafeContext::Context_Exclusive));