stacktracejs / stackframe

JS Object representation of a stack frame.
https://www.stacktracejs.com/#!/docs/stackframe
MIT License
77 stars 16 forks source link

Add support for anonymous functions (eval) #12

Closed genemars closed 7 years ago

genemars commented 8 years ago

Given an error stack like this one:

ReferenceError: a is not defined
    at $$.onStart (eval at <anonymous> (http://localhost:8080/hg/html/js/homegenie.webapp.js?version=r525:6851:25), <anonymous>:32:7)
    at $$.RenderWidget (http://localhost:8080/hg/html/js/homegenie.webapp.js?version=r525:6770:36)
    at $$.RenderView (http://localhost:8080/hg/html/js/homegenie.webapp.js?version=r525:6757:12)
    at http://localhost:8080/hg/html/js/homegenie.webapp.js?version=r525:6879:24
    at Object.$.ajax.success (http://localhost:8080/hg/html/js/homegenie.api.js?version=r525:724:21)
    at l (http://localhost:8080/hg/html/js/jquery-2.0.2.min.js:3:24881)
    at Object.c.fireWith [as resolveWith] (http://localhost:8080/hg/html/js/jquery-2.0.2.min.js:3:25702)
    at k (http://localhost:8080/hg/html/js/jquery-2.0.2.min.js:5:4919)
    at XMLHttpRequest.<anonymous> (http://localhost:8080/hg/html/js/jquery-2.0.2.min.js:5:8723)

stackframe will currently ignore the eval <anonymous>:32:7 at the end of the first stack element, which is the real source of the error at line 32, column 7. It will indeed report stack[0] with line 6851 and column 25.

eriwen commented 7 years ago

@genielabs Stackframe itself handles eval origins as you can setEvalOrigin(Stackframe). However, error-stack-parser does not set eval origins yet, so I'm going to move this issue to that project. Thanks for submitting.

eriwen commented 7 years ago

Issue moved to stacktracejs/error-stack-parser #32 via ZenHub