mirror of
https://github.com/ruby/ruby.git
synced 2025-09-21 03:24:00 +02:00
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:
parent
2fb1564c02
commit
44caca11cf
2 changed files with 21 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue