insns.def: preserve encoding
* insns.def (defineclass): preserve encoding of name in error messages for non-class super. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
491ace2dbe
commit
b90a5f9334
@ -1,4 +1,7 @@
|
|||||||
Mon Jun 29 02:06:51 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Mon Jun 29 02:08:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* insns.def (defineclass): preserve encoding of name in error
|
||||||
|
messages for non-class super.
|
||||||
|
|
||||||
* insns.def (defineclass): preserve encoding of name in error
|
* insns.def (defineclass): preserve encoding of name in error
|
||||||
messages when already defined but type mismatch.
|
messages when already defined but type mismatch.
|
||||||
|
@ -844,8 +844,8 @@ defineclass
|
|||||||
|
|
||||||
if (VM_DEFINECLASS_HAS_SUPERCLASS_P(flags) &&
|
if (VM_DEFINECLASS_HAS_SUPERCLASS_P(flags) &&
|
||||||
!RB_TYPE_P(super, T_CLASS)) {
|
!RB_TYPE_P(super, T_CLASS)) {
|
||||||
rb_raise(rb_eTypeError, "superclass must be a Class (%s given)",
|
rb_raise(rb_eTypeError, "superclass must be a Class (% "PRIsVALUE" given)",
|
||||||
rb_obj_classname(super));
|
rb_obj_class(super));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (super == Qnil) {
|
if (super == Qnil) {
|
||||||
|
@ -359,6 +359,16 @@ class TestClass < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
m = Module.new
|
||||||
|
n = "M\u{1f5ff}"
|
||||||
|
c = m.module_eval "class #{n}; new; end"
|
||||||
|
assert_raise_with_message(TypeError, /#{n}/) {
|
||||||
|
eval <<-"end;"
|
||||||
|
class C < c
|
||||||
|
end
|
||||||
|
end;
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_cloned_singleton_method_added
|
def test_cloned_singleton_method_added
|
||||||
|
Loading…
x
Reference in New Issue
Block a user