Reputation: 2054
I have used one function in my application which through error message.
This I have done to identify the error line number and file location.
That is fine it work good but I am confused for those line numbers because it has 2 value for each.
Please have look on one of same error message:
Error
at Object.Core.initAlert (http://localhost/demo/core.js:205:22)
at http://localhost/demo/app.js:26:10
at _setImmediate (http://localhost/demo/async.js:182:20)
at http://localhost/demo/async.js:234:13
at http://localhost/demo/async.js:113:13
at _arrayEach (http://localhost/demo/async.js:85:13)
at _forEachOf (http://localhost/demo/async.js:112:9)
at _each (http://localhost/demo/async.js:77:13)
at Object.async.forEachOf.async.eachOf (http://localhost/demo/async.js:233:9)
at Object.async.forEach.async.each (http://localhost/demo/async.js:210:22)
You can see at last of line there are two line numbers and I am confused here that which one is the line number for function statement. First one or second.
For ex. IN first line:
at Object.Core.initAlert (http://localhost/demo/core.js:205:22)
205 and 22 are there
Do anyone know about it....
Or is there any other way to track stack of execution in javascript.
Upvotes: 1
Views: 74
Reputation: 4358
at Object.Core.initAlert (http://localhost/demo/core.js:205:22)
205: is line number and 22: column number.
Link for more information to understand stack traces.
Web Inspector - Understanding Stack Traces
Chrome Developer Tools Understanding
Upvotes: 0
Reputation: 56823
The first number tells you the line number.
The second number represents the character starting position in that line where the error occurred.
Upvotes: 0
Reputation: 10756
The first number is the line number, the second number is the column number.
Upvotes: 4