<commit_before>var ErrorStackParser = require('error-stack-parser');

var UNKNOWN_FUNCTION = '?';


function guessFunctionName(url, line) {
  return UNKNOWN_FUNCTION;
}

function gatherContext(url, line) {
  return null;
}

function Frame(stackFrame) {
  var data = {};

  data._stackFrame = stackFrame;

  data.url = stackFrame.fileName;
  data.line = stackFrame.lineNumber;
  data.func = stackFrame.functionName;
  data.column = stackFrame.columnNumber;
  data.args = stackFrame.args;

  data.context = gatherContext(data.url, data.line);

  return data;
};

function Stack(e) {
  function getStack() {
    var parserStack = [];

    try {
      parserStack = ErrorStackParser.parse(e);
    } catch(e) {
      parserStack = [];
    }

    var stack = [];

    for (var i = 0; i < parserStack.length; i++) {
      stack.push(new Frame(parserStack[i]));
    }

    return stack;
  }

  return {
    stack: getStack(),
    message: e.message,
    name: e.name
  };<commit_msg>Change argument name in Stack() to fix uglify bug.<commit_after>var ErrorStackParser = require('error-stack-parser');

var UNKNOWN_FUNCTION = '?';


function guessFunctionName(url, line) {
  return UNKNOWN_FUNCTION;
}

function gatherContext(url, line) {
  return null;
}

function Frame(stackFrame) {
  var data = {};

  data._stackFrame = stackFrame;

  data.url = stackFrame.fileName;
  data.line = stackFrame.lineNumber;
  data.func = stackFrame.functionName;
  data.column = stackFrame.columnNumber;
  data.args = stackFrame.args;

  data.context = gatherContext(data.url, data.line);

  return data;
};

function Stack(exception) {
  function getStack() {
    var parserStack = [];

    try {
      parserStack = ErrorStackParser.parse(exception);
    } catch(e) {
      parserStack = [];
    }

    var stack = [];

    for (var i = 0; i < parserStack.length; i++) {
      stack.push(new Frame(parserStack[i]));
    }

    return stack;
  }

  return {
    stack: getStack(),
    message: exception.message,
    name: exception.name
  };
{'fraction_non_alphanumeric': 0.13125309559187717, 'fraction_numerical': 0.0009905894006934125, 'mean_word_length': 3.261603375527426, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5174766', 'n_tokens_mistral': 666, 'n_tokens_neox': 641, 'n_words': 142}