From 57560080203dce3845d4b52bfb8fc03db1e9718a Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 15 Feb 2002 06:14:26 +0000 Subject: * eval.c (rb_eval): replace rb_cvar_declare() by rb_cvar_set(). * eval.c (assign): ditto. * variable.c (rb_cvar_set): 4th argument (warn) added; define new class variable if it's not defined yet. * variable.c (rb_cvar_declare): removed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index c53889031..1bc78c72d 100644 --- a/eval.c +++ b/eval.c @@ -2864,12 +2864,12 @@ rb_eval(self, n) if (ruby_verbose && FL_TEST(ruby_cbase, FL_SINGLETON)) { rb_warn("declaring singleton class variable"); } - rb_cvar_declare(ruby_cbase, node->nd_vid, result); + rb_cvar_set(ruby_cbase, node->nd_vid, result, Qtrue); break; case NODE_CVASGN: result = rb_eval(self, node->nd_value); - rb_cvar_set(ruby_cbase, node->nd_vid, result); + rb_cvar_set(ruby_cbase, node->nd_vid, result, Qfalse); break; case NODE_LVAR: @@ -3915,11 +3915,11 @@ assign(self, lhs, val, pcall) if (ruby_verbose && FL_TEST(ruby_cbase, FL_SINGLETON)) { rb_warn("declaring singleton class variable"); } - rb_cvar_declare(ruby_cbase, lhs->nd_vid, val); + rb_cvar_set(ruby_cbase, lhs->nd_vid, val, Qtrue); break; case NODE_CVASGN: - rb_cvar_set(ruby_cbase, lhs->nd_vid, val); + rb_cvar_set(ruby_cbase, lhs->nd_vid, val, Qfalse); break; case NODE_MASGN: -- cgit