push the name down into callable
blocks need a name too if just for debug, and stacks
This commit is contained in:
@ -11,7 +11,7 @@ module Parfait
|
||||
@obj = Parfait.object_space.get_type_by_class_name(:Object)
|
||||
@args = Parfait::Type.for_hash( @obj.object_class , { bar: :Integer , foo: :Type})
|
||||
@frame = Parfait::Type.for_hash( @obj.object_class , { local_bar: :Integer , local_foo: :Type})
|
||||
@method = Parfait::CallableMethod.new( @obj , :meth , @args , @frame)
|
||||
@method = Parfait::CallableMethod.new( :meth , @obj , @args , @frame)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -19,6 +19,11 @@ module Parfait
|
||||
def test_block_in_method
|
||||
assert @method.has_block( @method.create_block(@args , @frame ))
|
||||
end
|
||||
|
||||
def test_block_hash_name
|
||||
assert_equal :meth_block , @method.create_block( @args , @frame ).name
|
||||
end
|
||||
def test_type_name
|
||||
assert_equal 6 , @method.create_block( @args , @frame ).get_type.variable_index(:name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -96,7 +96,7 @@ module Parfait
|
||||
assert_equal @method , @method
|
||||
end
|
||||
def test_not_equal
|
||||
method = Parfait::CallableMethod.new( @obj , :other , @args , @frame)
|
||||
method = Parfait::CallableMethod.new( :other , @obj , @args , @frame)
|
||||
assert @method != method
|
||||
end
|
||||
def test_create_block
|
||||
@ -106,5 +106,8 @@ module Parfait
|
||||
def test_has_block
|
||||
assert_equal 7 , @method.get_type.variable_index( :blocks )
|
||||
end
|
||||
def test_has_name
|
||||
assert_equal 6 , @method.get_type.variable_index( :name )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -14,7 +14,7 @@ module Parfait
|
||||
end
|
||||
def foo_method( for_class = :Try)
|
||||
args = Parfait::Type.for_hash( @try_class , { bar: :Integer})
|
||||
::Parfait::CallableMethod.new( @space.get_type_by_class_name(for_class) , :foo , args,empty_frame)
|
||||
::Parfait::CallableMethod.new( :foo ,@space.get_type_by_class_name(for_class) , args,empty_frame)
|
||||
end
|
||||
def add_foo_to( clazz = :Try )
|
||||
foo = foo_method( clazz )
|
||||
|
Reference in New Issue
Block a user