aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_lambda.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-26 02:26:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-26 02:26:49 +0000
commit6a8d0097095d975fbd19cf62c83645b51886025b (patch)
tree639da612ae29e88b7c46437933d5994076343cb0 /test/ruby/test_lambda.rb
parent767848e0b782152fa2652a37532950f42e0c3012 (diff)
downloadruby-6a8d0097095d975fbd19cf62c83645b51886025b.tar.gz
* compile.c (iseq_compile_each): call on special object instead of
self. since stabby lambda is a syntax, so it should not be affected by the context. [ruby-core:42349][Bug #5966] * insns.def (send): no special deal for FCALL. self should be put on TOS instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_lambda.rb')
-rw-r--r--test/ruby/test_lambda.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_lambda.rb b/test/ruby/test_lambda.rb
index 02bb26939d..ae12c6d609 100644
--- a/test/ruby/test_lambda.rb
+++ b/test/ruby/test_lambda.rb
@@ -63,4 +63,11 @@ class TestLambdaParameters < Test::Unit::TestCase
def foo
assert_equal(nil, ->(&b){ b }.call)
end
+
+ def test_in_basic_object
+ bug5966 = '[ruby-core:42349]'
+ called = false
+ BasicObject.new.instance_eval {->() {called = true}.()}
+ assert_equal(true, called, bug5966)
+ end
end