function callerFile(offset) {
  var error = new Error();

  return function() {
    var line = (error.stack || '').split('\n')[offset];

    // Clean up the stack trace line
    if (line) {
      if (line.indexOf('@') !== -1) {
        // Firefox
        line = line.substring(line.indexOf('@') + 1);
      } else {
        // Chrome
        line = line.substring(line.indexOf('(') + 1).replace(')', '');
      }
    }

    return line || '';
  };
}
Returns a function that gets the file name and line number from a
location in the stack if available based on the call site.

Note: this returns another function because accessing .stack is very
expensive in Chrome.

@param {Number} offset Number of stack lines to skip