module Estreet::Function

Public Class Methods

new(params, body) click to toggle source
# File lib/estreet/function.rb, line 3
def initialize(params, body)
  # TODO: join multiple blocks in the body, or whatever?
  # TODO: allow body to be an expression -- ES6 expression closure

  @params = params.map(&:to_pattern)
  @body   = body.to_block
end

Public Instance Methods

attributes() click to toggle source
Calls superclass method
# File lib/estreet/function.rb, line 11
def attributes
  # does super work here (i.e. in a module)?
  super.merge(
    generator: false, # ES6?
    expression: false, # ES6?
    defaults: [], # ES6?
    rest: nil, # ??
    params: @params,
    body: @body
  )
end