Wrong (?) bytecode for local functions within try blocks.

RESOLVED WORKSFORME

Status

()

defect
RESOLVED WORKSFORME
9 years ago
3 years ago

People

(Reporter: bhackett, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

var f;
function test(length)
{
  try
  {
    function f() { }
    f();
  }
  catch(ex)
  {
    print("Threw " + ex);
  }
}
test();

This gives me:

TypeError: f is not a function

V8 and JSC don't throw, which looks like the right behavior to me.  If I disassemble the bytecode, the access to f is a CALLGLOBAL, as if the local is not in scope.
Assignee: general → nobody
No longer reproducible, probably fixed when the new block-Level Function declaration semantics were implemented. Resolving as WFM.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.