mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #5946 from dearblue/const-search
Don't switch constant search path from modules to Object
This commit is contained in:
+1
-1
@@ -785,7 +785,7 @@ L_RETRY:
|
||||
c = c->super;
|
||||
if (!skip && c == mrb->object_class) break;
|
||||
}
|
||||
if (!retry && base->tt == MRB_TT_MODULE) {
|
||||
if (!retry && base->tt == MRB_TT_MODULE && skip) {
|
||||
c = mrb->object_class;
|
||||
retry = TRUE;
|
||||
goto L_RETRY;
|
||||
|
||||
@@ -211,6 +211,7 @@ assert('Nested const reference') do
|
||||
end
|
||||
assert_equal "hello world", Syntax4Const::CONST1
|
||||
assert_equal "hello world", Syntax4Const::Const2.new.const1
|
||||
assert_raise(NameError) { Syntax4Const::Object }
|
||||
end
|
||||
|
||||
assert('Abbreviated variable assignment as returns') do
|
||||
|
||||
Reference in New Issue
Block a user