Sha256: 3c4ba4bdc82583eb3e9e30b42a3fab8844e9daf2f34da08f4d325f8ed314314f
Contents?: true
Size: 886 Bytes
Versions: 16
Compression:
Stored size: 886 Bytes
Contents
module Ruby2JS class Converter # (defs (self) :foo # (args) # (...) # NOTE: defp is only produced by filters handle :defs, :defp do |target, method, args, body| parse transform_defs(target, method, args, body) end def transform_defs(target, method, args, body) if not @ast.is_method? or @ast.type == :defp s(:prop, target, method.to_s => {enumerable: s(:true), configurable: s(:true), get: s(:block, s(:send, nil, :proc), args, s(:autoreturn, body))}) elsif method =~ /=$/ s(:prop, target, method.to_s.sub('=', '') => {enumerable: s(:true), configurable: s(:true), set: s(:block, s(:send, nil, :proc), args, body)}) else s(:send, target, "#{method}=", s(:block, s(:send, nil, :lambda), args, body)) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems