Skip to content
This repository has been archived by the owner on Aug 18, 2018. It is now read-only.

Commit

Permalink
Renamed a helper method.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarnette committed Apr 21, 2008
1 parent 813e756 commit f80ba37
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ext/spidermonkey/js_land_proxy.c
Expand Up @@ -123,7 +123,7 @@ static JSBool respond_to_p(JSContext* js_context, JSObject* obj, char* name)
|| has_key_p(self, name);
}

static jsval property_get(OurContext * context, char * property) {
static jsval evaluate_js_property_expression(OurContext * context, char * property) {
jsval retval;
JSBool ok = JS_EvaluateScript(context->js, context->global,
property, strlen(property), NULL, 1,
Expand Down Expand Up @@ -162,14 +162,10 @@ static JSBool get(JSContext* js_context, JSObject* obj, jsval id, jsval* retval)
char* name = JS_GetStringBytes(JSVAL_TO_STRING(id));
VALUE ruby_id = rb_intern(name);

// FIXME: this is necessarily ugly. Maybe we should write something like
// jsval foo = property_expression(context->js, context->global, "Johnson.Generator.create")
// this would make the code where we look up Johnson.Symbol cleaner too (in conversions.c)

// FIXME: we should probably just JS_DefineProperty this, and it shouldn't be enumerable

if (!strcasecmp("__iterator__", name)) {
*retval = property_get(context, "Johnson.Generator.create");
*retval = evaluate_js_property_expression(context, "Johnson.Generator.create");
return JS_TRUE;
}

Expand Down

0 comments on commit f80ba37

Please sign in to comment.