diff --git a/ChangeLog b/ChangeLog index 49e1a45488..ce7364f215 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue May 6 00:00:02 2008 Yukihiro Matsumoto + + * 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 * insns.def (defineclass): was using wrong variable. [ruby-dev:34592] diff --git a/compile.c b/compile.c index 7b077a30b4..93bcb8a12f 100644 --- a/compile.c +++ b/compile.c @@ -4310,7 +4310,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) rb_sprintf("", 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)); diff --git a/insns.def b/insns.def index ba7beec33c..0850fab32f 100644 --- a/insns.def +++ b/insns.def @@ -972,8 +972,11 @@ defineclass 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); diff --git a/version.h b/version.h index 5358af259b..c0a1b0043c 100644 --- a/version.h +++ b/version.h @@ -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[];