'use babel'

const extractionRegex = /at (.*?) \((.*?):(\d+):(\d+)\)/

export function capture() {
  const toReturn = []
  const stack = new Error().stack.split('\n')

  stack.shift()
  stack.forEach(function(entry) {
    const matches = extractionRegex.exec(entry)
    if (matches !== null) {
      toReturn.push({
        function: matches[1],
        file: matches[2],
        line: parseInt(matches[3]) || 1,
        col: parseInt(matches[4]) || 1
      })
    }
  })
  // Remove self from the stack
  toReturn.shift()

  return toReturn
}

@@ -105,49 +105,170 @@
 st t
-oReturn = %5B%5D%0A  const stack = new Error().
+races = fromStack(new Error().stack)%0A  // Remove self from the stack%0A  traces.shift()%0A  return traces%0A%7D%0A%0Aexport function fromStack(stack) %7B%0A  const stackChunks = 
 stac
@@ -285,32 +285,36 @@
 n')%0A
-%0A
   
-stack.shift()
+const traces = %5B%5D%0A
 %0A  stack
 .for
@@ -309,16 +309,22 @@
 %0A  stack
+Chunks
 .forEach
@@ -425,23 +425,21 @@
 %0A      t
-oReturn
+races
 .push(%7B%0A
@@ -598,76 +598,23 @@
  %7D)%0A
-  // Remove self from the stack%0A  toReturn.shift()%0A%0A  return toReturn
+%0A  return traces
 %0A%7D%0A

Add fromStack method