Unverified Commit 5cdf1eab authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #5555 from dearblue/str-ref-regexp

Partially allow overriding of `String#[]` methods
parents 07f805aa 8c355ec7
......@@ -1261,8 +1261,16 @@ RETRY_TRY_BLOCK:
regs[a] = mrb_hash_get(mrb, va, vb);
break;
case MRB_TT_STRING:
switch (mrb_type(vb)) {
case MRB_TT_INTEGER:
case MRB_TT_STRING:
case MRB_TT_RANGE:
regs[a] = mrb_str_aref(mrb, va, vb, mrb_undef_value());
break;
default:
goto getidx_fallback;
}
break;
default:
getidx_fallback:
c = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment