Merge pull request #3278 from bouk/dup-class

Copy over INSTANCE_TT when duping class
This commit is contained in:
Yukihiro "Matz" Matsumoto
2016-11-30 03:52:56 +09:00
committed by GitHub
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -285,6 +285,7 @@ copy_class(mrb_state *mrb, mrb_value dst, mrb_value src)
}
dc->mt = kh_copy(mt, mrb, sc->mt);
dc->super = sc->super;
MRB_SET_INSTANCE_TT(dc, MRB_INSTANCE_TT(sc));
}
static void
+8
View File
@@ -221,6 +221,14 @@ assert('Kernel#dup', '15.3.1.3.9') do
assert_false c.respond_to?(:test)
end
assert('Kernel#dup class') do
assert_nothing_raised do
Array.dup.new(200)
Range.dup.new(2, 3)
String.dup.new("a"*50)
end
end
# Kernel#eval is provided by mruby-eval mrbgem '15.3.1.3.12'
assert('Kernel#extend', '15.3.1.3.13') do