mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
parent
b7b31ebce5
commit
7160e074f6
3 changed files with 28 additions and 1 deletions
|
@ -2212,7 +2212,7 @@ local_id:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$$ = install_ID($1, current_module.c_str(),
|
$$ = install_ID($1, current_module.c_str(),
|
||||||
false, is_export).release();
|
false, false).release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
3
testing/btest/Baseline/language.locals-to-global/.stdout
Normal file
3
testing/btest/Baseline/language.locals-to-global/.stdout
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
|
one
|
||||||
|
two
|
24
testing/btest/language/locals-to-global.zeek
Normal file
24
testing/btest/language/locals-to-global.zeek
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
# @TEST-DOC: Ensure that locals are not hoisted to global scope.
|
||||||
|
# @TEST-EXEC: zeek -b %INPUT
|
||||||
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER= btest-diff .stdout
|
||||||
|
|
||||||
|
module Test;
|
||||||
|
|
||||||
|
export {
|
||||||
|
function func1()
|
||||||
|
{
|
||||||
|
local t: string = "one";
|
||||||
|
print t;
|
||||||
|
}
|
||||||
|
function func2()
|
||||||
|
{
|
||||||
|
local t: string = "two";
|
||||||
|
print t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
event zeek_init()
|
||||||
|
{
|
||||||
|
func1();
|
||||||
|
func2();
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue