diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-03-14 15:16:09 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-03-14 15:16:09 -0300 |
commit | 94d38560c3095190fa2c868cbf7bcf39ca444568 (patch) | |
tree | b68480036d7d92dc38f68953e53757f52fdc06a8 /testes/errors.lua | |
parent | c2dc6e8e947ed0c7b18d452592f722f56ee1f96a (diff) | |
download | lua-94d38560c3095190fa2c868cbf7bcf39ca444568.tar.gz lua-94d38560c3095190fa2c868cbf7bcf39ca444568.tar.bz2 lua-94d38560c3095190fa2c868cbf7bcf39ca444568.zip |
Wrong error message when using "_ENV" fields
The string "_ENV" is erroneously identified as a variable _ENV,
so that results from a field is classified as a global.
Diffstat (limited to 'testes/errors.lua')
-rw-r--r-- | testes/errors.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/testes/errors.lua b/testes/errors.lua index d83e6023..c1c40fec 100644 --- a/testes/errors.lua +++ b/testes/errors.lua | |||
@@ -162,6 +162,9 @@ checkmessage("aaa=(1)..{}", "a table value") | |||
162 | -- bug in 5.4.6 | 162 | -- bug in 5.4.6 |
163 | checkmessage("a = {_ENV = {}}; print(a._ENV.x + 1)", "field 'x'") | 163 | checkmessage("a = {_ENV = {}}; print(a._ENV.x + 1)", "field 'x'") |
164 | 164 | ||
165 | -- a similar bug, since 5.4.0 | ||
166 | checkmessage("print(('_ENV').x + 1)", "field 'x'") | ||
167 | |||
165 | _G.aaa, _G.bbbb = nil | 168 | _G.aaa, _G.bbbb = nil |
166 | 169 | ||
167 | -- calls | 170 | -- calls |