summaryrefslogtreecommitdiff
path: root/sample/test.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-03-08 07:03:09 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-03-08 07:03:09 +0000
commitd497898c231f124ba187e2650be8af20b47b1a97 (patch)
treed7fbdd608eb0698296838406ea964328994e342c /sample/test.rb
parentd41f53d0b6ceaec8b9fffc9f79ee9335b2a25175 (diff)
* eval.c (cvar_cbase): utility function to find innermost non
singleton cbase. * eval.c (is_defined): adopt new cvar behavior. * eval.c (rb_eval): ditto. * eval.c (assign): ditto. * class.c (rb_mod_clone): should not call rb_obj_clone(), since Module does not provide "allocate". * class.c (rb_singleton_class): should crate new singleton class if obj is a class or module and attached object is different, which means metaclass of singleton class is sought. * time.c (time_s_alloc): now follows allocation framework. * eval.c (rb_eval): should initialize outer class variables from methods in singleton class definitions. * eval.c (assign): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/test.rb')
-rw-r--r--sample/test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/sample/test.rb b/sample/test.rb
index 82b159a7b7..1f6b140951 100644
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -1351,6 +1351,17 @@ atlas = Titans.new
test_ok(atlas.ruler0 == "Cronus")
test_ok(atlas.ruler3 == "Zeus")
+class <<a="a"
+ def foo=(n)
+ @@cv=n
+ end
+ def foo
+ @@cv
+ end
+end
+a.foo=5
+test_ok(a.foo == 5)
+
test_check "trace"
$x = 1234
$y = 0