yarv-diff:223
From: ko1 atdot.net
Date: 11 Feb 2006 11:22:08 -0000
Subject: [yarv-diff:223] r380 - in trunk: . yarvtest
Author: ko1
Date: 2006-02-11 20:22:05 +0900 (Sat, 11 Feb 2006)
New Revision: 380
Modified:
trunk/
trunk/ChangeLog
trunk/insns.def
trunk/test.rb
trunk/yarvtest/test_class.rb
Log:
r554@leremita: ko1 | 2006-02-11 20:21:21 +0900
* insns.def : fix [yarv-dev:831]
* yarvtest/test_class.rb : add a test for above
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- 81cd9672-7512-7e48-ae48-6936450e977d:/local/yarv/trunk:552
+ 81cd9672-7512-7e48-ae48-6936450e977d:/local/yarv/trunk:554
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-02-11 05:42:50 UTC (rev 379)
+++ trunk/ChangeLog 2006-02-11 11:22:05 UTC (rev 380)
@@ -4,6 +4,13 @@
# from Mon, 03 May 2004 01:24:19 +0900
#
+2006-02-11(Sat) 20:20:18 +0900 Koichi Sasada <ko1 atdot.net>
+
+ * insns.def : fix [yarv-dev:831]
+
+ * yarvtest/test_class.rb : add a test for above
+
+
2006-02-11(Sat) 14:29:01 +0900 Koichi Sasada <ko1 atdot.net>
* rb/mklog.rb : use svk
Modified: trunk/insns.def
===================================================================
--- trunk/insns.def 2006-02-11 05:42:50 UTC (rev 379)
+++ trunk/insns.def 2006-02-11 11:22:05 UTC (rev 380)
@@ -279,7 +279,16 @@
if(NIL_P(klass)){
rb_raise(rb_eTypeError, "no class/module to define constant");
}
-
+
+ switch (TYPE(klass)) {
+ case T_CLASS:
+ case T_MODULE:
+ break;
+ default:
+ rb_raise(rb_eTypeError, "%s is not a class/module",
+ RSTRING(rb_obj_as_string(klass))->ptr);
+ }
+
rb_const_set(klass, id, val);
INC_VM_STATE_VERSION();
}
Modified: trunk/test.rb
===================================================================
--- trunk/test.rb 2006-02-11 05:42:50 UTC (rev 379)
+++ trunk/test.rb 2006-02-11 11:22:05 UTC (rev 380)
@@ -1,3 +1,7 @@
+1::A = 1
+
+__END__
+
begin
require 'thread'
rescue LoadError
Modified: trunk/yarvtest/test_class.rb
===================================================================
--- trunk/yarvtest/test_class.rb 2006-02-11 05:42:50 UTC (rev 379)
+++ trunk/yarvtest/test_class.rb 2006-02-11 11:22:05 UTC (rev 380)
@@ -530,6 +530,15 @@
end
}
end
+
+ def test_set_const_not_class
+ ae %q{
+ begin
+ 1::A = 1
+ rescue TypeError => e
+ e.message
+ end
+ }
+ end
end
-
--
ML: yarv-diff quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml