Closed Bug 56318 Opened 24 years ago Closed 24 years ago

function literals with names don't work right

Categories

(Rhino Graveyard :: Core, defect, P3)

x86
Linux
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: david, Assigned: norrisboyd)

Details

ECMA v3 (section 13) allows function literals to have names so you can write anonymous recursive functions. But it doesn't work right in rhino: var f = function fact(x) { if (x <= 1) return 1; else return x*fact(x-1); }; print(f(5)); This results in js> js: "<stdin>", line 12: uncaught JavaScript exception: ReferenceError: "fact" is not defined. (<stdin>; line 12)
I'm working on this--it's harder than it looks.
Status: NEW → ASSIGNED
Fixed. The name of the function is assigned to a local variable in the function prolog when appropriate.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.