Understanding Chrome javascript stacktrace

I have a few questions regarding the following javascript stacktrace.

  • Why is there two parts on the stack: the first in red on top and the second in black below?
  • What does the first line starting with at mean? those. at angular.js:63 : why doesn't this apply to a function / method call like other lines?
  • How is this ordered? Are the lines below displayed before the lines above?

javascript stacktrace

+6
source share
2 answers
  • The bits in red is the exception / error message - in this case it looks like Angular throws an exception and as part of this exception adds the contents of the stacktrace message to the message, while the black bits are the stack trace that you get whenever the browser an unhandled exception occurs.
    • The first line in the states where the error occurred - script name and line number - if you look at the source of angular.js on line 63, you will see an expression in which there was an exception.
    • This does not apply to the function call, as it is the operator that threw the exception. The only way to get this statement is through a series of function calls, which are then displayed in reverse order.
  • Right. For example, the Scope.$apply function makes a call to Scope.$eval and Scope.$eval calls a function called callback , etc.

+3
source

Chrome uses the v8 engine to work with JavaScript. So, I quote the following link for the answer - https://code.google.com/p/v8-wiki/wiki/JavaScriptStackTraceApi

  • I am not sure about the answer to this question.

  • The first line indicates the place where the error occurred. With a framework like angular, it can be deep inside the framework in which it should not be user code.

  • Yes, this is from the bottom up, that is, from the point where the error occurred up to the caller, in this case, to send the jQuery event.

+1
source

Source: https://habr.com/ru/post/986735/


All Articles