0
@@ -58,7 +58,7 @@ static VALUE call_ruby_from_js_invoke(VALUE args)
0
return rb_apply(self, SYM2ID(id), args);
0
-JSBool call_ruby_from_js_va(
OurContext* context, VALUE* result, VALUE self, ID id, int argc, va_list va)
0
+JSBool call_ruby_from_js_va(
JohnsonRuntime* runtime, VALUE* result, VALUE self, ID id, int argc, va_list va)
0
VALUE old_errinfo = ruby_errinfo;
0
VALUE args = rb_ary_new2(argc + 2);
0
@@ -74,27 +74,27 @@ JSBool call_ruby_from_js_va(OurContext* context, VALUE* result, VALUE self, ID i
0
*result = rb_protect(call_ruby_from_js_invoke, args, &state);
0
- return report_ruby_error_in_js(
context, state, old_errinfo);
0
+ return report_ruby_error_in_js(
runtime, state, old_errinfo);
0
-JSBool call_ruby_from_js(
OurContext* context, jsval* retval, VALUE self, ID id, int argc, ...)
0
+JSBool call_ruby_from_js(
JohnsonRuntime* runtime, jsval* retval, VALUE self, ID id, int argc, ...)
0
- JSBool okay = call_ruby_from_js_va(
context, &result, self, id, argc, va);
0
+ JSBool okay = call_ruby_from_js_va(
runtime, &result, self, id, argc, va);
0
if (!okay) return JS_FALSE;
0
- return retval ? convert_to_js(
context, result, retval) : JS_TRUE;
0
+ return retval ? convert_to_js(
runtime, result, retval) : JS_TRUE;
0
-JSBool call_ruby_from_js2(
OurContext* context, VALUE* retval, VALUE self, ID id, int argc, ...)
0
+JSBool call_ruby_from_js2(
JohnsonRuntime* runtime, VALUE* retval, VALUE self, ID id, int argc, ...)
0
- JSBool okay = call_ruby_from_js_va(
context, retval, self, id, argc, va);
0
+ JSBool okay = call_ruby_from_js_va(
runtime, retval, self, id, argc, va);
0
@@ -163,8 +163,8 @@ static bool respond_to_p(JSContext* js_context, JSObject* obj, char* name)
0
VALUE ruby_context = (VALUE)JS_GetContextPrivate(js_context);
0
- Data_Get_Struct(ruby_context, OurContext, context);
0
+ JohnsonContext* context;
0
+ Data_Get_Struct(ruby_context, JohnsonContext, context);
0
VALUE self = (VALUE)JS_GetInstancePrivate(
0
context->js, obj, JS_GET_CLASS(context->js, obj), NULL);
0
@@ -179,8 +179,9 @@ static bool respond_to_p(JSContext* js_context, JSObject* obj, char* name)
0
|| has_key_p(self, name);
0
-static jsval evaluate_js_property_expression(OurContext * context, const char * property, jsval* retval) {
0
- return JS_EvaluateScript(context->js, context->global,
0
+static jsval evaluate_js_property_expression(JohnsonRuntime * runtime, const char * property, jsval* retval) {
0
+ JSContext * context = johnson_get_current_context(runtime);
0
+ return JS_EvaluateScript(context, runtime->global,
0
property, strlen(property), "johnson:evaluate_js_property_expression", 1,
0
@@ -193,10 +194,14 @@ static JSBool get(JSContext* js_context, JSObject* obj, jsval id, jsval* retval)
0
// get our struct, which is embedded in ruby_context
0
- Data_Get_Struct(ruby_context, OurContext, context);
0
+ JohnsonContext* context;
0
+ JohnsonRuntime* runtime;
0
+ Data_Get_Struct(ruby_context, JohnsonContext, context);
0
- PREPARE_JROOTS(context, 1);
0
+ VALUE ruby_runtime = (VALUE)JS_GetRuntimePrivate(JS_GetRuntime(js_context));
0
+ Data_Get_Struct(ruby_runtime, JohnsonRuntime, runtime);
0
+ PREPARE_JROOTS(js_context, 1);
0
// get the Ruby object that backs this proxy
0
@@ -209,7 +214,7 @@ static JSBool get(JSContext* js_context, JSObject* obj, jsval id, jsval* retval)
0
if (indexable_p(self)) {
0
VALUE idx = INT2FIX(JSVAL_TO_INT(id));
0
- JCHECK(call_ruby_from_js(
context, retval, self, rb_intern("[]"), 1, idx));
0
+ JCHECK(call_ruby_from_js(
runtime, retval, self, rb_intern("[]"), 1, idx));
0
@@ -221,7 +226,7 @@ static JSBool get(JSContext* js_context, JSObject* obj, jsval id, jsval* retval)
0
// FIXME: we should probably just JS_DefineProperty this, and it shouldn't be enumerable
0
if (!strcasecmp("__iterator__", name)) {
0
- JCHECK(evaluate_js_property_expression(
context, "Johnson.Generator.create", retval));
0
+ JCHECK(evaluate_js_property_expression(
runtime, "Johnson.Generator.create", retval));
0
// if the Ruby object has a dynamic js property with a key
0
@@ -230,7 +235,7 @@ static JSBool get(JSContext* js_context, JSObject* obj, jsval id, jsval* retval)
0
else if (autovivified_p(ruby_context, self, name))
0
- JCHECK(call_ruby_from_js(
context, retval, Johnson_SpiderMonkey_JSLandProxy(),
0
+ JCHECK(call_ruby_from_js(
runtime, retval, Johnson_SpiderMonkey_JSLandProxy(),
0
rb_intern("autovivified"), 2, self, rb_str_new2(name)));
0
@@ -239,14 +244,14 @@ static JSBool get(JSContext* js_context, JSObject* obj, jsval id, jsval* retval)
0
else if (const_p(self, name))
0
- JCHECK(call_ruby_from_js(
context, retval, self, rb_intern("const_get"),
0
+ JCHECK(call_ruby_from_js(
runtime, retval, self, rb_intern("const_get"),
0
// otherwise, if it's a global, return the global
0
else if (global_p(name))
0
- JCHECK(convert_to_js(
context, rb_gv_get(name), retval));
0
+ JCHECK(convert_to_js(
runtime, rb_gv_get(name), retval));
0
// otherwise, if the Ruby object has a an attribute method matching
0
@@ -254,7 +259,7 @@ static JSBool get(JSContext* js_context, JSObject* obj, jsval id, jsval* retval)
0
else if (attribute_p(self, name))
0
- JCHECK(call_ruby_from_js(
context, retval, self, ruby_id, 0));
0
+ JCHECK(call_ruby_from_js(
runtime, retval, self, ruby_id, 0));
0
// otherwise, if the Ruby object quacks sorta like a hash (it responds to
0
@@ -262,7 +267,7 @@ static JSBool get(JSContext* js_context, JSObject* obj, jsval id, jsval* retval)
0
else if (has_key_p(self, name))
0
- JCHECK(call_ruby_from_js(
context, retval, self, rb_intern("[]"), 1, rb_str_new2(name)));
0
+ JCHECK(call_ruby_from_js(
runtime, retval, self, rb_intern("[]"), 1, rb_str_new2(name)));
0
// otherwise, it's a method being accessed as a property, which means
0
@@ -273,7 +278,7 @@ static JSBool get(JSContext* js_context, JSObject* obj, jsval id, jsval* retval)
0
else if (method_p(self, name))
0
- JCHECK(call_ruby_from_js(
context, retval, self, rb_intern("method"), 1, rb_str_new2(name)));
0
+ JCHECK(call_ruby_from_js(
runtime, retval, self, rb_intern("method"), 1, rb_str_new2(name)));
0
// else it's undefined (JS_VOID) by default
0
@@ -284,7 +289,7 @@ static JSBool get(JSContext* js_context, JSObject* obj, jsval id, jsval* retval)
0
static JSBool get_and_destroy_resolved_property(
0
JSContext* js_context, JSObject* obj, jsval id, jsval* retval)
0
- PREPARE_JROOTS(
OUR_CONTEXT(js_context), 1);
0
+ PREPARE_JROOTS(
js_context, 1);
0
char* name = JS_GetStringBytes(JSVAL_TO_STRING(id));
0
JCHECK(JS_DeleteProperty(js_context, obj, name));
0
@@ -296,10 +301,14 @@ static JSBool set(JSContext* js_context, JSObject* obj, jsval id, jsval* value)
0
VALUE ruby_context = (VALUE)JS_GetContextPrivate(js_context);
0
- Data_Get_Struct(ruby_context, OurContext, context);
0
+ JohnsonContext* context;
0
+ JohnsonRuntime* runtime;
0
+ Data_Get_Struct(ruby_context, JohnsonContext, context);
0
+ VALUE ruby_runtime = (VALUE)JS_GetRuntimePrivate(JS_GetRuntime(js_context));
0
+ Data_Get_Struct(ruby_runtime, JohnsonRuntime, runtime);
0
- PREPARE_JROOTS(
context, 2);
0
+ PREPARE_JROOTS(
js_context, 2);
0
@@ -312,46 +321,46 @@ static JSBool set(JSContext* js_context, JSObject* obj, jsval id, jsval* value)
0
VALUE idx = INT2FIX(JSVAL_TO_INT(id));
0
- VALUE val = CONVERT_TO_RUBY(
context, *value);
0
+ VALUE val = CONVERT_TO_RUBY(
runtime, *value);
0
- JCHECK(call_ruby_from_js(
context, NULL, self, rb_intern("[]="), 2, idx, val));
0
+ JCHECK(call_ruby_from_js(
runtime, NULL, self, rb_intern("[]="), 2, idx, val));
0
- VALUE ruby_key = CONVERT_TO_RUBY(context, id);
0
- VALUE ruby_value = CONVERT_TO_RUBY(context, *value);
0
+ VALUE ruby_key = CONVERT_TO_RUBY(runtime, id);
0
+ VALUE ruby_value = CONVERT_TO_RUBY(runtime, *value);
0
VALUE setter = rb_str_append(rb_str_new3(ruby_key), rb_str_new2("="));
0
VALUE setter_id = rb_intern(StringValueCStr(setter));
0
VALUE settable_p, indexable_p;
0
- JCHECK(call_ruby_from_js2(context, &settable_p, self, rb_intern("respond_to?"), 1, ID2SYM(setter_id)));
0
- JCHECK(call_ruby_from_js2(context, &indexable_p, self, rb_intern("respond_to?"), 1, ID2SYM(rb_intern("[]="))));
0
+ JCHECK(call_ruby_from_js2(runtime, &settable_p, self, rb_intern("respond_to?"), 1, ID2SYM(setter_id)));
0
+ JCHECK(call_ruby_from_js2(runtime, &indexable_p, self, rb_intern("respond_to?"), 1, ID2SYM(rb_intern("[]="))));
0
- JCHECK(call_ruby_from_js2(context, &method, self, rb_intern("method"), 1, ID2SYM(setter_id)));
0
- JCHECK(call_ruby_from_js2(context, &arity, method, rb_intern("arity"), 0));
0
+ JCHECK(call_ruby_from_js2(runtime, &method, self, rb_intern("method"), 1, ID2SYM(setter_id)));
0
+ JCHECK(call_ruby_from_js2(runtime, &arity, method, rb_intern("arity"), 0));
0
// if the Ruby object has a 1-arity method named "property=",
0
// call it with the converted value
0
if (NUM2INT(arity) == 1)
0
- JCHECK(call_ruby_from_js(
context, NULL, self, setter_id, 1, ruby_value));
0
+ JCHECK(call_ruby_from_js(
runtime, NULL, self, setter_id, 1, ruby_value));
0
// otherwise, if the Ruby object quacks sorta like a hash for assignment
0
// (it responds to "[]="), assign it by key
0
- JCHECK(call_ruby_from_js(
context, NULL, self, rb_intern("[]="), 2, ruby_key, ruby_value));
0
+ JCHECK(call_ruby_from_js(
runtime, NULL, self, rb_intern("[]="), 2, ruby_key, ruby_value));
0
- JCHECK(call_ruby_from_js(
context, NULL, Johnson_SpiderMonkey_JSLandProxy(), rb_intern("autovivify"),
0
+ JCHECK(call_ruby_from_js(
runtime, NULL, Johnson_SpiderMonkey_JSLandProxy(), rb_intern("autovivify"),
0
3, self, ruby_key, ruby_value));
0
@@ -362,19 +371,23 @@ static JSBool construct(JSContext* js_context, JSObject* UNUSED(obj), uintN argc
0
VALUE ruby_context = (VALUE)JS_GetContextPrivate(js_context);
0
- Data_Get_Struct(ruby_context, OurContext, context);
0
+ JohnsonContext* context;
0
+ JohnsonRuntime* runtime;
0
+ Data_Get_Struct(ruby_context, JohnsonContext, context);
0
- PREPARE_JROOTS(context, 0);
0
+ VALUE ruby_runtime = (VALUE)JS_GetRuntimePrivate(JS_GetRuntime(js_context));
0
+ Data_Get_Struct(ruby_runtime, JohnsonRuntime, runtime);
0
- VALUE klass = CONVERT_TO_RUBY(context, JS_ARGV_CALLEE(argv));
0
+ PREPARE_JROOTS(js_context, 0);
0
+ VALUE klass = CONVERT_TO_RUBY(runtime, JS_ARGV_CALLEE(argv));
0
VALUE args = rb_ary_new();
0
for (i = 0; i < argc; ++i)
0
- rb_ary_push(args, CONVERT_TO_RUBY(
context, argv[i]));
0
+ rb_ary_push(args, CONVERT_TO_RUBY(
runtime, argv[i]));
0
- JCHECK(call_ruby_from_js(
context, retval, Johnson_SpiderMonkey_JSLandProxy(),
0
+ JCHECK(call_ruby_from_js(
runtime, retval, Johnson_SpiderMonkey_JSLandProxy(),
0
rb_intern("send_with_possible_block"), 3, klass, ID2SYM(rb_intern("new")), args));
0
@@ -383,10 +396,10 @@ static JSBool resolve(JSContext *js_context, JSObject *obj, jsval id, uintN UNUS
0
VALUE ruby_context = (VALUE)JS_GetContextPrivate(js_context);
0
- Data_Get_Struct(ruby_context, OurContext, context);
0
+ JohnsonContext* context;
0
+ Data_Get_Struct(ruby_context, JohnsonContext, context);
0
- PREPARE_JROOTS(
context, 1);
0
+ PREPARE_JROOTS(
js_context, 1);
0
char* name = JS_GetStringBytes(JS_ValueToString(js_context, id));
0
@@ -406,14 +419,18 @@ static JSBool to_string(JSContext* js_context, JSObject* obj, uintN UNUSED(argc)
0
VALUE ruby_context = (VALUE)JS_GetContextPrivate(js_context);
0
- Data_Get_Struct(ruby_context, OurContext, context);
0
+ JohnsonContext* context;
0
+ JohnsonRuntime* runtime;
0
+ Data_Get_Struct(ruby_context, JohnsonContext, context);
0
+ VALUE ruby_runtime = (VALUE)JS_GetRuntimePrivate(JS_GetRuntime(js_context));
0
+ Data_Get_Struct(ruby_runtime, JohnsonRuntime, runtime);
0
- PREPARE_JROOTS(
context, 0);
0
+ PREPARE_JROOTS(
js_context, 0);
0
VALUE self = (VALUE)JS_GetInstancePrivate(context->js, obj, JS_GET_CLASS(context->js, obj), NULL);
0
- JCHECK(call_ruby_from_js(
context, retval, self, rb_intern("to_s"), 0));
0
+ JCHECK(call_ruby_from_js(
runtime, retval, self, rb_intern("to_s"), 0));
0
@@ -421,14 +438,18 @@ static JSBool to_array(JSContext* js_context, JSObject* obj, uintN UNUSED(argc),
0
VALUE ruby_context = (VALUE)JS_GetContextPrivate(js_context);
0
- Data_Get_Struct(ruby_context, OurContext, context);
0
+ JohnsonContext* context;
0
+ JohnsonRuntime* runtime;
0
+ Data_Get_Struct(ruby_context, JohnsonContext, context);
0
- PREPARE_JROOTS(context, 0);
0
+ VALUE ruby_runtime = (VALUE)JS_GetRuntimePrivate(JS_GetRuntime(js_context));
0
+ Data_Get_Struct(ruby_runtime, JohnsonRuntime, runtime);
0
+ PREPARE_JROOTS(js_context, 0);
0
VALUE self = (VALUE)JS_GetInstancePrivate(context->js, obj, JS_GET_CLASS(context->js, obj), NULL);
0
- JCHECK(call_ruby_from_js(
context, retval, self, rb_intern("to_a"), 0));
0
+ JCHECK(call_ruby_from_js(
runtime, retval, self, rb_intern("to_a"), 0));
0
@@ -436,10 +457,14 @@ static JSBool method_missing(JSContext* js_context, JSObject* obj, uintN argc, j
0
VALUE ruby_context = (VALUE)JS_GetContextPrivate(js_context);
0
- Data_Get_Struct(ruby_context, OurContext, context);
0
+ JohnsonContext* context;
0
+ JohnsonRuntime* runtime;
0
+ Data_Get_Struct(ruby_context, JohnsonContext, context);
0
+ VALUE ruby_runtime = (VALUE)JS_GetRuntimePrivate(JS_GetRuntime(js_context));
0
+ Data_Get_Struct(ruby_runtime, JohnsonRuntime, runtime);
0
- PREPARE_JROOTS(
context, 0);
0
+ PREPARE_JROOTS(
js_context, 0);
0
VALUE self = (VALUE)JS_GetInstancePrivate(context->js, obj, JS_GET_CLASS(context->js, obj), NULL);
0
@@ -450,9 +475,9 @@ static JSBool method_missing(JSContext* js_context, JSObject* obj, uintN argc, j
0
// FIXME: this is horrible and lazy, to_a comes from enumerable on proxy (argv[1] is a JSArray)
0
- JCHECK(call_ruby_from_js2(
context, &args, CONVERT_TO_RUBY(context, argv[1]), rb_intern("to_a"), 0));
0
+ JCHECK(call_ruby_from_js2(
runtime, &args, CONVERT_TO_RUBY(runtime, argv[1]), rb_intern("to_a"), 0));
0
- JCHECK(call_ruby_from_js(
context, retval, Johnson_SpiderMonkey_JSLandProxy(),
0
+ JCHECK(call_ruby_from_js(
runtime, retval, Johnson_SpiderMonkey_JSLandProxy(),
0
rb_intern("send_with_possible_block"), 3, self, ID2SYM(ruby_id), args));
0
@@ -462,10 +487,14 @@ static JSBool call(JSContext* js_context, JSObject* UNUSED(obj), uintN argc, jsv
0
VALUE ruby_context = (VALUE)JS_GetContextPrivate(js_context);
0
- Data_Get_Struct(ruby_context, OurContext, context);
0
+ JohnsonContext* context;
0
+ JohnsonRuntime* runtime;
0
+ Data_Get_Struct(ruby_context, JohnsonContext, context);
0
- PREPARE_JROOTS(context, 0);
0
+ VALUE ruby_runtime = (VALUE)JS_GetRuntimePrivate(JS_GetRuntime(js_context));
0
+ Data_Get_Struct(ruby_runtime, JohnsonRuntime, runtime);
0
+ PREPARE_JROOTS(js_context, 0);
0
VALUE self = (VALUE)JS_GetInstancePrivate(context->js, JSVAL_TO_OBJECT(JS_ARGV_CALLEE(argv)), &JSLandCallableProxyClass, NULL);
0
@@ -473,29 +502,32 @@ static JSBool call(JSContext* js_context, JSObject* UNUSED(obj), uintN argc, jsv
0
for (i = 0; i < argc; ++i)
0
- rb_ary_push(args, CONVERT_TO_RUBY(
context, argv[i]));
0
+ rb_ary_push(args, CONVERT_TO_RUBY(
runtime, argv[i]));
0
- JCHECK(call_ruby_from_js(
context, retval, Johnson_SpiderMonkey_JSLandProxy(),
0
+ JCHECK(call_ruby_from_js(
runtime, retval, Johnson_SpiderMonkey_JSLandProxy(),
0
rb_intern("send_with_possible_block"), 3, self, ID2SYM(rb_intern("call")), args));
0
-bool js_value_is_proxy(
OurContext* MAYBE_UNUSED(context), jsval maybe_proxy)
0
+bool js_value_is_proxy(
JohnsonRuntime* MAYBE_UNUSED(runtime), jsval maybe_proxy)
0
- JSClass* klass = JS_GET_CLASS(context->js, JSVAL_TO_OBJECT(maybe_proxy));
0
+ JSClass* klass = JS_GET_CLASS(
0
+ johnson_get_current_context(runtime),
0
+ JSVAL_TO_OBJECT(maybe_proxy));
0
return &JSLandProxyClass == klass
0
|| &JSLandClassProxyClass == klass
0
|| &JSLandCallableProxyClass == klass;
0
-VALUE unwrap_js_land_proxy(
OurContext* context, jsval proxy)
0
+VALUE unwrap_js_land_proxy(
JohnsonRuntime* runtime, jsval proxy)
0
JSObject *proxy_object = JSVAL_TO_OBJECT(proxy);
0
+ JSContext * context = johnson_get_current_context(runtime);
0
- value = (VALUE)JS_GetInstancePrivate(context->js, proxy_object,
0
- JS_GET_CLASS(context->js, proxy_object), NULL);
0
+ value = (VALUE)JS_GetInstancePrivate(context, proxy_object,
0
+ JS_GET_CLASS(context, proxy_object), NULL);
0
@@ -506,27 +538,32 @@ static void finalize(JSContext* js_context, JSObject* obj)
0
- Data_Get_Struct(ruby_context, OurContext, context);
0
+ JohnsonContext* context;
0
+ JohnsonRuntime* runtime;
0
+ Data_Get_Struct(ruby_context, JohnsonContext, context);
0
+ VALUE ruby_runtime = (VALUE)JS_GetRuntimePrivate(JS_GetRuntime(js_context));
0
+ Data_Get_Struct(ruby_runtime, JohnsonRuntime, runtime);
0
VALUE self = (VALUE)JS_GetInstancePrivate(context->js, obj,
0
JS_GET_CLASS(context->js, obj), NULL);
0
// remove the proxy OID from the id map
0
- JS_HashTableRemove(
context->rbids, (void *)rb_obj_id(self));
0
+ JS_HashTableRemove(
runtime->rbids, (void *)rb_obj_id(self));
0
// free up the ruby value for GC
0
- call_ruby_from_js(
context, NULL, ruby_context, rb_intern("remove_gcthing"), 1, self);
0
+ call_ruby_from_js(
runtime, NULL, ruby_context, rb_intern("remove_gcthing"), 1, self);
0
-JSBool make_js_land_proxy(
OurContext* context, VALUE value, jsval* retval)
0
+JSBool make_js_land_proxy(
JohnsonRuntime* runtime, VALUE value, jsval* retval)
0
- jsid id = (jsid)JS_HashTableLookup(context->rbids, (void *)rb_obj_id(value));
0
+ JSContext * context = johnson_get_current_context(runtime);
0
+ jsid id = (jsid)JS_HashTableLookup(runtime->rbids, (void *)rb_obj_id(value));
0
- return JS_IdToValue(context
->js, id, retval);
0
+ return JS_IdToValue(context
, id, retval);
0
@@ -548,26 +585,26 @@ JSBool make_js_land_proxy(OurContext* context, VALUE value, jsval* retval)
0
klass = &JSLandCallableProxyClass;
0
- JCHECK((jsobj = JS_NewObject(context
->js, klass, NULL, NULL)));
0
+ JCHECK((jsobj = JS_NewObject(context
, klass, NULL, NULL)));
0
- JCHECK(JS_SetPrivate(context
->js, jsobj, (void*)value));
0
+ JCHECK(JS_SetPrivate(context
, jsobj, (void*)value));
0
- JCHECK(JS_DefineFunction(context
->js, jsobj, "__noSuchMethod__", method_missing, 2, 0));
0
+ JCHECK(JS_DefineFunction(context
, jsobj, "__noSuchMethod__", method_missing, 2, 0));
0
- JCHECK(JS_DefineFunction(context->js, jsobj, "toArray", to_array, 0, 0));
0
- JCHECK(JS_DefineFunction(context->js, jsobj, "toString", to_string, 0, 0));
0
+ JCHECK(JS_DefineFunction(context, jsobj, "toArray", to_array, 0, 0));
0
+ JCHECK(JS_DefineFunction(context, jsobj, "toString", to_string, 0, 0));
0
*retval = OBJECT_TO_JSVAL(jsobj);
0
- JCHECK(JS_ValueToId(context
->js, *retval, &newid));
0
+ JCHECK(JS_ValueToId(context
, *retval, &newid));
0
// put the proxy OID in the id map
0
- JCHECK(JS_HashTableAdd(
context->rbids, (void *)rb_obj_id(value), (void *)newid));
0
+ JCHECK(JS_HashTableAdd(
runtime->rbids, (void *)rb_obj_id(value), (void *)newid));
0
// root the ruby value for GC
0
- VALUE ruby_context = (VALUE)JS_GetContextPrivate(context
->js);
0
+ VALUE ruby_context = (VALUE)JS_GetContextPrivate(context
);
0
rb_funcall(ruby_context, rb_intern("add_gcthing"), 1, value);