1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

insns.def: preserve encoding

* insns.def (defineclass): preserve encoding of name in error
  messages for super class mismatch.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-06-28 17:10:26 +00:00
parent b90a5f9334
commit 548b97e70c
3 changed files with 9 additions and 3 deletions

View file

@ -1,4 +1,7 @@
Mon Jun 29 02:08:01 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
Mon Jun 29 02:10:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* insns.def (defineclass): preserve encoding of name in error
messages for super class mismatch.
* insns.def (defineclass): preserve encoding of name in error
messages for non-class super.

View file

@ -869,8 +869,8 @@ defineclass
tmp = rb_class_real(RCLASS_SUPER(klass));
if (tmp != super) {
rb_raise(rb_eTypeError, "superclass mismatch for class %s",
rb_id2name(id));
rb_raise(rb_eTypeError, "superclass mismatch for class % "PRIsVALUE"",
rb_id2str(id));
}
}
}

View file

@ -369,6 +369,9 @@ class TestClass < Test::Unit::TestCase
end
end;
}
assert_raise_with_message(TypeError, /#{n}/) {
m.module_eval "class #{n} < Class.new; end"
}
end
def test_cloned_singleton_method_added