Closed
Bug 95101
Opened 24 years ago
Closed 24 years ago
Problem with exception thrown for undefined function with v1.5r2
Categories
(Rhino Graveyard :: Core, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
1.5R3
People
(Reporter: pschwartau, Assigned: norrisboyd)
Details
Reported by brien.oberstein@transacttools.net:
We've noticed behavior that's changed between rhino 1.5r1 and 1.5r2.
When calling a function that has not been defined via evaluateString(),
the EcmaError that is thrown returns an (incorrect?) value for .getName().
Previously it returned ReferenceError whereas now it returns "undefined".
Not sure what the correct value is going strictly by the spec, but it seems
like EcmaErrors should probably not be returning 'undefined' in any case.
| Reporter | ||
Comment 1•24 years ago
|
||
Confirming bug on WinNT. If I load the Rhino shell, and call a
non-existent function "f", here is the output I get in RC1 vs. RC2:
RC1
js: "TEST.js", line 40: uncaught JavaScript exception:
ReferenceError: "f" is not defined.
(TEST.js; line 40)
RC2
js: "TEST.js", line 40: uncaught JavaScript exception:
undefined: "f" is not defined.
(TEST.js; line 40)
| Reporter | ||
Comment 2•24 years ago
|
||
However, if I use a try...catch block, the error is correctly caught
as a ReferenceError object in Rhino. Therefore the following testcase
is passing in both RC1 and RC2 of Rhino:
mozilla/js/tests/ecma_3/Exceptions/regress-95101.js
| Reporter | ||
Comment 3•24 years ago
|
||
The only way I can see the error is manually in the interactive shell,
as described above -
| Reporter | ||
Comment 4•24 years ago
|
||
Is there a method on the ReferenceError object that will allow me to
see the full error message? As in this pseudo-code:
try
{
fNONEXISTENT();
}
catch (e)
{
e.printFullError();
}
Does anything like that exist?
| Assignee | ||
Comment 5•24 years ago
|
||
There's e.toString() and e.message.
| Assignee | ||
Comment 6•24 years ago
|
||
Fixed:
Checking in NativeGlobal.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/NativeGlobal.java,v <-- N
ativeGlobal.java
new revision: 1.34; previous revision: 1.33
done
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 7•24 years ago
|
||
Improved the testcase above by testing e.toString().
Failed this before the fix; now passes.
Marking bug Verified Fixed -
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•