<!DOCTYPE html>
<html><head><title>Argument name shadowed by function declaration in method</title></head>

<body>
  <p>FAILED (script did not run)</p>

<script>

function test1(arg) {
  function arg() {};
  return arg;
}

function test2(arg) {
  return arg;
  function arg() {};
}

function test3(arg) {
  return arg;
  var arg = 0;
}

var failures = [];

typeof test1('hi') === 'function' || failures.push('Test 1 returned wrong value: ' + test1('hi'));
typeof test2('hi') === 'function' || failures.push('Test 2 returned wrong value: ' + test2('hi'));
typeof test3('hi') === 'undefined' || failures.push('Test 3 returned wrong value: ' + test3('hi'));

document.getElementsByTagName('p')[0].firstChild.data = failures.length > 0 ? 'FAILED - ' + failures : 'PASSED';
</script>
</body></html>

Test case for function argumens and inner functions having same name
Test case for function argumens and inner functions having same name
