Make constant assignments more conforming to JIS X 3017:2013 11.4.2.2.3

compile.c (NODE_CDECL): Evaluate the module before the value
test/ruby/test_const.rb (test_evaluation_order): added a test case
This commit is contained in:
Yuki Yugui Sonoda 2019-06-16 22:28:34 +09:00
parent 2fb1564c02
commit 44caca11cf
2 changed files with 21 additions and 8 deletions

View file

@ -69,4 +69,12 @@ PRE
def test_toplevel_lookup
assert_raise(NameError, '[Feature #11547]') {TestConst::Object}
end
def test_evaluation_order
assert_raise_with_message(RuntimeError, "recv", 'JIS X 3017:2013 11.4.2.2.3') {
eval <<~EOS
raise('recv')::C = raise('value')
EOS
}
end
end