changeset 36:be05a91e7b0a

Fixed TODOs in wrapper.cpp.
author Atul Varma <varmaa@toolness.com>
date Mon, 22 Jun 2009 15:54:37 -0700
parents 5899faf625d4
children 193ff16b013a
files wrapper.cpp
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/wrapper.cpp	Mon Jun 22 15:40:46 2009 -0700
+++ b/wrapper.cpp	Mon Jun 22 15:54:37 2009 -0700
@@ -98,7 +98,7 @@
         return JS_FALSE;
       }
       *idp = JSVAL_ZERO;
-      // TODO: Root the enumeration iterator?
+      JS_AddRoot(cx, statep);
       return JS_TRUE;
     }
     // TODO: Default behavior?
@@ -118,7 +118,7 @@
         if (klass && strcmp(klass->name, "StopIteration") == 0) {
           JS_ClearPendingException(cx);
           *statep = JSVAL_NULL;
-          // TODO: Unroot the enumeration iterator?
+          JS_RemoveRoot(cx, statep);
           return JS_TRUE;
         }
       }
@@ -128,7 +128,7 @@
       return JS_FALSE;
     return JS_TRUE;
   case JSENUMERATE_DESTROY:
-    // TODO: Unroot the enumeration iterator?
+    JS_RemoveRoot(cx, statep);
     return JS_TRUE;
   }
 }