Permalink
Browse files

There's a function for that.. except when there's not.

  • Loading branch information...
1 parent 1f5db6e commit c70f4aa738dd177dbace9f58e526de1d1e9500fa @matthewd committed Jun 1, 2010
Showing with 6 additions and 0 deletions.
  1. +2 −0 extconf.rb
  2. +4 −0 spidermonkey.c
View
@@ -10,4 +10,6 @@
have_func("JS_SetOperationCallback")
have_func("JS_SetBranchCallback")
+have_func("JS_GetPropertyById")
+
create_makefile("spidermonkey")
View
@@ -813,7 +813,11 @@ rbsm_each( JSContext* cx, jsval value, RBSMJS_YIELD yield, void* data ){
enm->id = enm->ida->vector[enm->i];
if( JS_IdToValue( enm->cx, enm->id, &enm->key ) ){
//enm->keystr = JS_GetStringBytes( JS_ValueToString( cx, enm->key ) );
+#ifdef HAVE_JS_GETPROPERTYBYID
if( JS_GetPropertyById( enm->cx, enm->obj, enm->id, &enm->val ) ){
+#else
+ if( OBJ_GET_PROPERTY( enm->cx, enm->obj, enm->id, &enm->val ) ){
+#endif
yield( enm );
}else{
JS_RemoveRoot( cx, &(enm->obj) );

0 comments on commit c70f4aa

Please sign in to comment.