ruby-changes:4805
From: ko1@a...
Date: Tue, 6 May 2008 00:02:03 +0900 (JST)
Subject: [ruby-changes:4805] matz - Ruby:r16299 (trunk): * compile.c (iseq_compile_each): should call compile_cpath() for
matz 2008-05-06 00:01:42 +0900 (Tue, 06 May 2008) New Revision: 16299 Modified files: trunk/ChangeLog trunk/compile.c trunk/insns.def trunk/version.h Log: * compile.c (iseq_compile_each): should call compile_cpath() for modules as well. [ruby-dev:34585] * insns.def (defineclass): add undef handling. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/version.h?r1=16299&r2=16298&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/compile.c?r1=16299&r2=16298&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16299&r2=16298&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/insns.def?r1=16299&r2=16298&diff_format=u Index: insns.def =================================================================== --- insns.def (revision 16298) +++ insns.def (revision 16299) @@ -972,8 +972,11 @@ case 2: /* val is dummy. classdef returns class scope value */ /* super is dummy */ - if (cbase == Qnil) { + if (cbase == Qundef) { cbase = vm_get_cbase(th); + if (NIL_P(cbase)) { + rb_raise(rb_eTypeError, "no class/module to define constant"); + } } vm_check_if_namespace(cbase); Index: ChangeLog =================================================================== --- ChangeLog (revision 16298) +++ ChangeLog (revision 16299) @@ -1,3 +1,10 @@ +Tue May 6 00:00:02 2008 Yukihiro Matsumoto <matz@r...> + + * compile.c (iseq_compile_each): should call compile_cpath() for + modules as well. [ruby-dev:34585] + + * insns.def (defineclass): add undef handling. + Mon May 5 23:49:40 2008 Yukihiro Matsumoto <matz@r...> * insns.def (defineclass): was using wrong variable. [ruby-dev:34592] Index: compile.c =================================================================== --- compile.c (revision 16298) +++ compile.c (revision 16299) @@ -4310,7 +4310,7 @@ rb_sprintf("<module:%s>", rb_id2name(node->nd_cpath->nd_mid)), ISEQ_TYPE_CLASS); - COMPILE(ret, "mbase", node->nd_cpath->nd_head); + compile_cpath(ret, iseq, node->nd_cpath); ADD_INSN (ret, nd_line(node), putnil); /* dummy */ ADD_INSN3(ret, nd_line(node), defineclass, ID2SYM(node->nd_cpath->nd_mid), iseqval, INT2FIX(2)); Index: version.h =================================================================== --- version.h (revision 16298) +++ version.h (revision 16299) @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2008-05-05" +#define RUBY_RELEASE_DATE "2008-05-06" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20080505 +#define RUBY_RELEASE_CODE 20080506 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2008 #define RUBY_RELEASE_MONTH 5 -#define RUBY_RELEASE_DAY 5 +#define RUBY_RELEASE_DAY 6 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/