Closed Bug 1296154 Opened 8 years ago Closed 8 years ago

Console does not display stack trace for uncaught non-Error

Categories

(Core :: JavaScript Engine, defect)

49 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 996060

People

(Reporter: voltrevo, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36 Steps to reproduce: Ran this code in jsbin: --- function MyError(message) { this.name = 'MyError'; this.message = message || 'Default Message'; this.stack = (new Error()).stack; } MyError.prototype = Object.create(Error.prototype); MyError.prototype.constructor = MyError; throw new MyError(); --- http://output.jsbin.com/vudiyo (This is the way MDN recommends extending Error: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) Actual results: Error in console did not provide access to stack trace. Expected results: Error in console should provide access to stack trace, probably in the same way as a plain throw new Error() would, which provides a triangle you can click to expand a textbox containing it.
this would be the issue for displaying stack trace for non-Error instance. moving to JavaScript Engine component as this is same on js shell.
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Console does not display stack trace for uncaught extended errors → Console does not display stack trace for uncaught non-Error
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.