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

Commit

Permalink
Fix some vestigal renaming issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarnette committed Apr 16, 2008
1 parent 84f5068 commit 510f1b5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ext/spidermonkey/js_land_proxy.c
Expand Up @@ -4,8 +4,8 @@ static JSBool get(JSContext* js_context, JSObject* obj, jsval id, jsval* retval)
static void finalize(JSContext* context, JSObject* obj);
static JSBool set(JSContext* context, JSObject* obj, jsval id, jsval* retval);

static JSClass ProxyInJSClass = {
"ProxyInJS", JSCLASS_HAS_PRIVATE,
static JSClass JSLandProxyClass = {
"JSLandProxy", JSCLASS_HAS_PRIVATE,
JS_PropertyStub,
JS_PropertyStub,
get,
Expand All @@ -31,7 +31,7 @@ static JSBool get(JSContext* js_context, JSObject* obj, jsval id, jsval* retval)
// get the Ruby object that backs this proxy

VALUE self;
assert(self = (VALUE)JS_GetInstancePrivate(context->js, obj, &ProxyInJSClass, NULL));
assert(self = (VALUE)JS_GetInstancePrivate(context->js, obj, &JSLandProxyClass, NULL));

char* key = JS_GetStringBytes(JSVAL_TO_STRING(id));
VALUE ruby_id = rb_intern(key);
Expand Down Expand Up @@ -92,7 +92,7 @@ static JSBool set(JSContext* js_context, JSObject* obj, jsval id, jsval* value)
Data_Get_Struct(ruby_context, OurContext, context);

VALUE self;
assert(self = (VALUE)JS_GetInstancePrivate(context->js, obj, &ProxyInJSClass, NULL));
assert(self = (VALUE)JS_GetInstancePrivate(context->js, obj, &JSLandProxyClass, NULL));

char* key = JS_GetStringBytes(JSVAL_TO_STRING(id));
VALUE ruby_key = rb_str_new2(key);
Expand Down Expand Up @@ -137,7 +137,7 @@ static JSBool method_missing(JSContext* js_context, JSObject* obj, uintN argc, j
Data_Get_Struct(ruby_context, OurContext, context);

VALUE self;
assert(self = (VALUE)JS_GetInstancePrivate(context->js, obj, &ProxyInJSClass, NULL));
assert(self = (VALUE)JS_GetInstancePrivate(context->js, obj, &JSLandProxyClass, NULL));

char* key = JS_GetStringBytes(JSVAL_TO_STRING(argv[0]));

Expand All @@ -156,13 +156,13 @@ static JSBool method_missing(JSContext* js_context, JSObject* obj, uintN argc, j

JSBool js_value_is_proxy(OurContext* context, jsval maybe_proxy)
{
return JS_InstanceOf(context->js, JSVAL_TO_OBJECT(maybe_proxy), &ProxyInJSClass, NULL);
return JS_InstanceOf(context->js, JSVAL_TO_OBJECT(maybe_proxy), &JSLandProxyClass, NULL);
}

VALUE unwrap_js_land_proxy(OurContext* context, jsval proxy)
{
VALUE value;
assert(value = (VALUE)JS_GetInstancePrivate(context->js, JSVAL_TO_OBJECT(proxy), &ProxyInJSClass, NULL));
assert(value = (VALUE)JS_GetInstancePrivate(context->js, JSVAL_TO_OBJECT(proxy), &JSLandProxyClass, NULL));
return value;
}

Expand All @@ -176,7 +176,7 @@ static void finalize(JSContext* js_context, JSObject* obj)
Data_Get_Struct(ruby_context, OurContext, context);

VALUE self;
assert(self = (VALUE)JS_GetInstancePrivate(context->js, obj, &ProxyInJSClass, NULL));
assert(self = (VALUE)JS_GetInstancePrivate(context->js, obj, &JSLandProxyClass, NULL));

// remove the proxy OID from the id map
JS_HashTableRemove(context->rbids, (void *)rb_obj_id(self));
Expand All @@ -199,7 +199,7 @@ jsval make_js_land_proxy(OurContext* context, VALUE value)
{
JSObject *jsobj;

assert(jsobj = JS_NewObject(context->js, &ProxyInJSClass, NULL, NULL));
assert(jsobj = JS_NewObject(context->js, &JSLandProxyClass, NULL, NULL));
assert(JS_SetPrivate(context->js, jsobj, (void*)value));
assert(JS_DefineFunction(context->js, jsobj, "__noSuchMethod__", method_missing, 2, 0));

Expand Down

0 comments on commit 510f1b5

Please sign in to comment.