From 44caca11cfa6bea01a1ef738846183f1a56d5658 Mon Sep 17 00:00:00 2001 From: Yuki Yugui Sonoda Date: Sun, 16 Jun 2019 22:28:34 +0900 Subject: 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 --- test/ruby/test_const.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/ruby/test_const.rb b/test/ruby/test_const.rb index 8784e0e988..fa512aa437 100644 --- a/test/ruby/test_const.rb +++ b/test/ruby/test_const.rb @@ -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 -- cgit v1.2.3