From b6681f29485dd349463ee63df00f5014b84b7b6d Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Thu, 13 May 2010 17:10:48 -0500 Subject: [PATCH] move function reflection into v8_function.cpp --- ext/v8/rr.cpp | 2 +- ext/v8/v8_func.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/v8/rr.cpp b/ext/v8/rr.cpp index 7629311..fe80ade 100644 --- a/ext/v8/rr.cpp +++ b/ext/v8/rr.cpp @@ -1,5 +1,6 @@ #include "rr.h" #include "v8_value.h" +#include "v8_func.h" #include "v8_str.h" using namespace v8; @@ -24,7 +25,6 @@ VALUE rr_str_to_camel_case(VALUE str) { VALUE rr_reflect_v8_array(Handle value); VALUE rr_reflect_v8_object(Handle value); -VALUE rr_reflect_v8_function(Handle value); VALUE rr_v82rb(Handle value) { if (value->IsUndefined() || value->IsNull()) { diff --git a/ext/v8/v8_func.cpp b/ext/v8/v8_func.cpp index eadeb72..3ff6342 100644 --- a/ext/v8/v8_func.cpp +++ b/ext/v8/v8_func.cpp @@ -61,6 +61,7 @@ void rr_init_func() { // rr_define_method(FunctionClass, "GetScriptOrigin", GetScriptOrigin, 0); } -void rr_reflec_v8_function(Handle value) { - +VALUE rr_reflect_v8_function(Handle value) { + Local f = Function::Cast(*value); + return V8_Ref_Create(FunctionClass, f); }