Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Implement V8 stack trace style #16

Open
gbrail opened this issue Jul 14, 2014 · 0 comments
Open

Implement V8 stack trace style #16

gbrail opened this issue Jul 14, 2014 · 0 comments

Comments

@gbrail
Copy link

gbrail commented Jul 14, 2014

For compatibility with V8, we'll add a stack trace style that works the way that V8's stack trace format works, for instance as follows:

at repl:1:1
at REPLServer.self.eval (repl.js:110:21)
at repl.js:249:20
at REPLServer.self.eval (repl.js:122:7)
at Interface.<anonymous> (repl.js:239:12)
at Interface.EventEmitter.emit (events.js:95:17)
at Interface._onLine (readline.js:202:10)
at Interface._line (readline.js:531:8)
at Interface._ttyWrite (readline.js:760:14)
at ReadStream.onkeypress (readline.js:99:10)

In other words, each line has the format:

at (::)

or, for anonymous functions:

at ::

Since we now have three stack trace styles, we will add the following functions:

RhinoException.setStackStyle(StackStyle style);
RhinoException.getStackStyle();

These use an object of type StackStyle, which is an enum-style object with three possible values:

StackStyle.RHINO -- the default
StackStyle.MOZILLA -- Mozilla style
StackStyle.V8 -- the new V8 style.

Finally, "RhinoException.setMozillaStackStyle(true)" will now call "setStackStyle" to set the Mozilla style.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant