Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1.  
  2. function getTrace() {
  3. try {
  4. throw new Error;
  5. }
  6. catch (ex) {
  7. var matches = [];
  8. ex.stack.replace(/([^\s]+):(\d+):(\d+)/g, function(all, file, line, column) {
  9. file = file.replace(/^[\s\(]/g, '');
  10. matches.push({"file": file, "line": line, "column": column});
  11. });
  12. matches.shift(); // Remove this function
  13. return matches;
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement