Closed Bug 194364 Opened 22 years ago Closed 22 years ago

function expression statements produces value

Categories

(Rhino Graveyard :: Core, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: user, Assigned: norrisboyd)

Details

Attachments

(1 file)

ECMA extension to support function expression statements in Rhino behaves differently from SM and MSIE as it produces value which affects eval results. For example, given the following, var x = eval('0; if (true) function f() {}') print(x) Rhino assigns to x the function f and prints function f() { } while SM assigns to x 0 and prints 0. With the standard function statements Rhino behaves correctly and print(eval('0; function f() {}')) gives correct 0.
Testcase added to JS testsuite: mozilla/js/tests/ecma_3/Statements/regress-194364.js Currently passing in SpiderMonkey, and failing in Rhino as Igor reported above -
I commited the fix
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Verified FIXED - the testcase in Comment #1 now passes in Rhino. I tested this with optimization levels -1, 0, 1, 9.
Status: RESOLVED → VERIFIED
Targeting as resolved against 1.5R5
Target Milestone: --- → 1.5R5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: