class V8::NamedPropertyGetter
def self.call(property, info)
def self.call(property, info) name = To.rb(property) obj = To.rb(info.This()) perl_name = To.perl_case(name) methods = obj.public_methods(false).map(&:to_s) method_name = if methods.include?(name) name elsif methods.include?(perl_name) perl_name end if method_name method = obj.method(method_name) if method.arity == 0 Function.rubycall(method) else To.v8(method) end else C::Empty end end
def self.call(property, info)
def self.call(property, info) methods = MethodInfo(To.rb(info.This())) if method = methods.find(To.rb(property)) if method.arity == 0 To.v8(method.call) else To.v8(method) end else C::Empty end # method_name = if methods.include?(name) # name # elsif methods.include?(perl_name) # perl_name # end # if method_name # method = obj.method(method_name) # if method.arity == 0 # To.v8(method.call()) # else # To.v8(method) # end # else # C::Empty # end # end d