diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-06-12 16:18:35 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-06-12 16:18:35 +0900 |
| commit | 56593764c8408b503c481109b746e417b289f721 (patch) | |
| tree | b9da2275e906ed0b76bf197553a63dabc8be667a /src/vm.c | |
| parent | f7777f64e6f8bbbe7048306e2834eb5726d2676b (diff) | |
| parent | b45d95fa9e825f10154207cf6411ea515b071c2b (diff) | |
| download | mruby-56593764c8408b503c481109b746e417b289f721.tar.gz mruby-56593764c8408b503c481109b746e417b289f721.zip | |
Merge pull request #5476 from dearblue/eval+super
Raise `TypeError` with `super` inside `instance_eval` / `class_eval`
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1725,13 +1725,12 @@ RETRY_TRY_BLOCK: else if (target_class->tt == MRB_TT_MODULE) { target_class = mrb_vm_ci_target_class(ci); if (target_class->tt != MRB_TT_ICLASS) { - mrb_value exc = mrb_exc_new_lit(mrb, E_RUNTIME_ERROR, "superclass info lost [mruby limitations]"); - mrb_exc_set(mrb, exc); - goto L_RAISE; + goto super_typeerror; } } recv = regs[0]; if (!mrb_obj_is_kind_of(mrb, recv, target_class)) { + super_typeerror: ; mrb_value exc = mrb_exc_new_lit(mrb, E_TYPE_ERROR, "self has wrong type to call super in this context"); mrb_exc_set(mrb, exc); |
