fixed a bug of not checking a function name against named variables

This commit is contained in:
2009-06-28 06:42:53 +00:00
parent b9d3b490a2
commit 3c63104bf7
4 changed files with 19 additions and 9 deletions

View File

@ -1,6 +1,6 @@
function f(f)
function f(x)
{
print f;
print x;
f("my hello");
}

View File

@ -1,3 +1,3 @@
# should print 50
function fn(f) { f = 20; }
BEGIN { f = 50; fn(100); print f; }
# should print 50
function fn(f) { f = 20; }
BEGIN { f = 50; fn(100); print f; }

View File

@ -1,3 +1,3 @@
# A function and a named variable cannot have the same name.
function a () { }
BEGIN { a = 20; }
function a () { }
BEGIN { a = 20; }