class CodeTools::AST::DefaultArguments

Attributes

arguments[RW]
names[RW]

Public Class Methods

new(line, block) click to toggle source
# File lib/rubinius/code/ast/definitions.rb, line 600
def initialize(line, block)
  @line = line
  array = block.array
  @names = array.map { |a| a.name }
  @arguments = array
end

Public Instance Methods

bytecode(g) click to toggle source
# File lib/rubinius/code/ast/definitions.rb, line 611
def bytecode(g)
  @arguments.each do |arg|
    done = g.new_label

    arg.variable.get_bytecode(g)
    g.goto_if_not_undefined done
    arg.bytecode(g)
    g.pop

    done.set!
  end
end
map_arguments(scope) click to toggle source
# File lib/rubinius/code/ast/definitions.rb, line 607
def map_arguments(scope)
  @arguments.each { |var| scope.assign_local_reference var }
end
to_sexp() click to toggle source
# File lib/rubinius/code/ast/definitions.rb, line 624
def to_sexp
  @arguments.map { |x| x.to_sexp }
end