Closed Bug 1427228 Opened 7 years ago Closed 7 years ago

Error stack shows inconsistent function name

Categories

(Core :: JavaScript Engine, defect, P3)

58 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 1371591

People

(Reporter: saschanaz, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0 Build ID: 20171227100314 Steps to reproduce: Slightly modified example from MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name ```js var sym1 = Symbol("foo"); var sym2 = "foo" var o = { [sym1]: function(){ throw new Error() }, [sym2]: function(){ throw new Error() } }; ``` Actual results: ``` > o[sym1] function o() > o[sym1].name "[foo]" > try { o[sym1]() } catch (e) { console.error(e.stack) } o@debugger eval code:4:29 @debugger eval code:1:7 > o[sym2] function o() > o[sym2].name "foo" > try { o[sym2]() } catch (e) { console.error(e.stack) } o@debugger eval code:5:29 @debugger eval code:1:7 ``` Expected results: ``` > o[sym1] function [foo]() > o[sym1].name "[foo]" > try { o[sym1]() } catch (e) { console.error(e.stack) } [foo]@debugger eval code:4:29 @debugger eval code:1:7 > o[sym2] function foo() > o[sym2].name "foo" > try { o[sym2]() } catch (e) { console.error(e.stack) } foo@debugger eval code:5:29 @debugger eval code:1:7 ``` Related: https://github.com/kripken/emscripten/issues/5911
Component: Untriaged → Developer Tools: Debugger
Component: Developer Tools: Debugger → JavaScript Engine
Product: Firefox → Core
Waldo, would this be something you could mentor?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jwalden+bmo)
Priority: -- → P3
Just looking at the testcase, I'm not sure I know off the top of my head the code paths it runs through. I'm happy to review a patch here -- tho I'd have to learn about the code being modified to do so. But in terms of answering ongoing questions about how to approach this or similar, I'm probably not the right person to mentor this, actually.
Flags: needinfo?(jwalden+bmo)
This specific case will be fixed by bug 1371591. Also related is bug 1140680 to use the current value of the "name" property of functions in the stack trace à la V8.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.