Bug 79548 - Error.stack includes newlines after function names
Summary: Error.stack includes newlines after function names
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-24 18:02 PST by Timothy Hatcher
Modified: 2012-03-11 15:50 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2012-02-24 18:02:41 PST
Error.stack seems to include a newline after function names.

["myStackTrace
", "bar
", "foo
", "eval code", "eval@[native code]"]

It shouldn't.
Comment 1 Gavin Barraclough 2012-03-11 15:47:00 PDT
Hi Tim,

Error.stack is no longer an array, and is now just a string.
As such, I think the newlines are now necessary to separate the functions, and to get the stack as a array without newlines you just need to use .stack.split('\n').

Does this seem good to you, or are you hoping for a different interface? - if it's good as is, let's close this bug.

cheers,
G.
Comment 2 Timothy Hatcher 2012-03-11 15:50:48 PDT
Ugly, but it is fine. (I know this is for compatability reasons.)