   .+     # message
 $ ///
 
+# Firefox.
+funcFileLineRe = /// ^
+  (.*)@ # function
+  (.+): # file
+  (\d+) # line
+$ ///
+
 parseStack = (e, stack) ->
   stack = e.stack or ''
   lines = stack.split('\n')
 
   backtrace = []
   for line, i in lines
-    if line == '' then continue
+    continue if line == ''
 
     m = line.match(funcAliasFileLineColumnRe)
     if m
       backtrace.push({
-        function: m[1]
-        file: m[3]
-        line: parseInt(m[4])
-        column: parseInt(m[5])
+        function: m[1],
+        file: m[3] or '',
+        line: m[4] and parseInt(m[4]) or 0,
+        column: m[5] and parseInt(m[5]) or 0,
       })
       continue
 
     m = line.match(funcFileLineColumnRe)
     if m
       backtrace.push({
-        function: m[1]
-        file: m[2]
-        line: parseInt(m[3])
-        column: parseInt(m[4])
+        function: m[1],
+        file: m[2] or '',
+        line: m[3] and parseInt(m[3]) or 0,
+        column: m[4] and parseInt(m[4]) or 0,
       })
       continue
 
     m = line.match(fileLineColumnRe)
     if m
       backtrace.push({
-        function: ''
-        file: m[1]
-        line: parseInt(m[2], 10)
-        column: parseInt(m[3], 10)
+        function: '',
+        file: m[1],
+        line: parseInt(m[2], 10),
+        column: parseInt(m[3], 10),
       })
       continue
 

# Chrome.
funcAliasFileLineColumnRe = /// ^
  \s{4}at\s
  (\S+)\s         # function
  \[as\s(\S+)\]\s # alias
  \(
    (.+):         # file
    (\d+):        # line
    (\d+)         # column
  \)
$ ///

# Chrome.
funcFileLineColumnRe = /// ^
  \s{4}at\s
  (\S+)\s   # function
  \(
    (.+):   # file
    (\d+):  # line
    (\d+)   # column
  \)
$ ///

# Firefox.
funcFileLineRe = /// ^
  (\S*)@ # function
  (.+):  # file
  (\d+)  # line
$ ///

# Chrome.

    type = ''

  return {
    'type': type,
    'message': msg,
    'backtrace': backtrace,
  }


