[macruby-changes] [3038] MacRuby/trunk/test_vm/method.rb
source_changes at macosforge.org
source_changes at macosforge.org
Sun Nov 22 05:42:49 PST 2009
Revision: 3038
http://trac.macosforge.org/projects/ruby/changeset/3038
Author: eloy.de.enige at gmail.com
Date: 2009-11-22 05:42:44 -0800 (Sun, 22 Nov 2009)
Log Message:
-----------
Added test_vm test which shows that calling a method instance raises the safe level.
Modified Paths:
--------------
MacRuby/trunk/test_vm/method.rb
Modified: MacRuby/trunk/test_vm/method.rb
===================================================================
--- MacRuby/trunk/test_vm/method.rb 2009-11-21 17:36:03 UTC (rev 3037)
+++ MacRuby/trunk/test_vm/method.rb 2009-11-22 13:42:44 UTC (rev 3038)
@@ -77,3 +77,15 @@
D.new
p :ok
}
+
+assert '0', %{
+ class X; def self.foo(x); x * 2; end; end
+ X.method(:foo).call(21)
+ p $SAFE
+}
+
+assert '0', %{
+ class X; def foo(x); x * 2; end; end
+ X.new.method(:foo).call(21)
+ p $SAFE
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20091122/21fc4ef5/attachment.html>
More information about the macruby-changes
mailing list