Closed
Bug 194364
Opened 22 years ago
Closed 22 years ago
function expression statements produces value
Categories
(Rhino Graveyard :: Core, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
1.5R5
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.
Comment 1•22 years ago
|
||
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 -
Reporter | ||
Comment 2•22 years ago
|
||
Reporter | ||
Comment 3•22 years ago
|
||
I commited the fix
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 4•22 years ago
|
||
Verified FIXED - the testcase in Comment #1 now passes in Rhino.
I tested this with optimization levels -1, 0, 1, 9.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•