Closed
Bug 167328
Opened 22 years ago
Closed 20 years ago
Need more information in certain error messages
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: pschwartau, Assigned: khanson)
Details
In testing Brendan's patch for bug 167325, I found that certain
error messages do not include the error type or line number:
js> var obj = {toString: function() {return new Object();}}
js> obj
can't convert Object to string
Compare this one, where we get both:
js> eval('foo')
13: ReferenceError: foo is not defined
Reporter | ||
Comment 1•22 years ago
|
||
Brendan has diagnosed the problem:
> It would be nice if the shell included the filename (if not stdin) and
> line number, and the error type tag, but JS_ValueToString can't find
> the filename and line number when called directly from js.c:Process
> (native code) with no frames active on cx (the error reporting code
> normally looks for filename and lineno in the topmost frame's script).
> The lack of "ReferenceError: " comes from a difference between
> js_ReportUncaughtException, which invokes toString on the exception
> object (which includes that type tag), and the normal error reporting
> code. mccabe (who did this code) may have just not noticed this
> difference.
Comment 2•22 years ago
|
||
The lack of filename info on JS errors is a dup of Bug #52116
*** This bug has been marked as a duplicate of 52116 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Comment 3•22 years ago
|
||
No, no it's not.
First, this bug is not just about a lack of file/line information, as you can
read in Phil's first sentence ("error type or line number").
Second, the bug in 52116 is about the browser (component: browser-general) not
providing file and line information to the JS engine. The file/line portion of
this bug is about the JS engine (component: JavaScript engine) not displaying
that information in certain error cases, even when the calling code has provided
such context.
Reopening.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Comment 4•20 years ago
|
||
I checked in a test js/tests/js1_5/Regress/regress-167328.js which shows we do
the right thing except in the case where you evaluate the |obj| in the shell.
Brendan says -> WONTFIX.
Status: REOPENED → RESOLVED
Closed: 22 years ago → 20 years ago
QA Contact: pschwartau → moz
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•