changeset 75:36d57955327e

Removed wrapper.cpp's dependency on string.h.
author Atul Varma <varmaa@toolness.com>
date Thu, 25 Jun 2009 19:53:45 -0700
parents ed2cf86a7c9d
children 78da824faeb3
files wrapper.cpp
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/wrapper.cpp	Thu Jun 25 18:56:23 2009 -0700
+++ b/wrapper.cpp	Thu Jun 25 19:53:45 2009 -0700
@@ -36,8 +36,6 @@
 
 #include "wrapper.h"
 
-#include "string.h"
-
 // Reserved slot ID for the resolver (meta) object
 #define SLOT_RESOLVER 0
 
@@ -114,8 +112,9 @@
           return JS_FALSE;
         if (!JSVAL_IS_OBJECT(exception))
           return JS_FALSE;
-        JSClass *klass = JS_GET_CLASS(cx, JSVAL_TO_OBJECT(exception));
-        if (klass && strcmp(klass->name, "StopIteration") == 0) {
+        JSClass *clasp = JS_GET_CLASS(cx, JSVAL_TO_OBJECT(exception));
+        if (clasp &&
+            JSCLASS_CACHED_PROTO_KEY(clasp) == JSProto_StopIteration) {
           JS_ClearPendingException(cx);
           *statep = JSVAL_NULL;
           JS_RemoveRoot(cx, statep);