<commit_before>export default class RouteContext {
  constructor(routes, route) {
    let routeIndex = routes.indexOf(route)
    this.parentRoutes = routes.slice(0, routeIndex)
  }

  trigger() {
    let parentRoutes = this.parentRoutes
    for (let i = parentRoutes.length - 1; i >= 0; i--) {
      let channel = parentRoutes[i]._contextChannel
      if (channel) {
        channel.trigger.apply(channel, arguments)
      }
    }
  }

  request(name) {
    let parentRoutes = this.parentRoutes
    for (let i = parentRoutes.length - 1; i >= 0; i--) {
      let channel = parentRoutes[i]._contextChannel
      if (channel && channel._requests[name]) {
        return channel.request.apply(channel, arguments)
      }
    }
  }
}<commit_msg>Rewrite RouteContext as a function constructor instead of a class<commit_after>function RouteContext(routes, route) {
  let routeIndex = routes.indexOf(route)
  this.parentRoutes = routes.slice(0, routeIndex)
}

RouteContext.prototype.trigger = function() {
  let parentRoutes = this.parentRoutes
  for (let i = parentRoutes.length - 1; i >= 0; i--) {
    let channel = parentRoutes[i]._contextChannel
    if (channel) {
      channel.trigger.apply(channel, arguments)
    }
  }
}

RouteContext.prototype.request = function(name) {
  let parentRoutes = this.parentRoutes
  for (let i = parentRoutes.length - 1; i >= 0; i--) {
    let channel = parentRoutes[i]._contextChannel
    if (channel && channel._requests[name]) {
      return channel.request.apply(channel, arguments)
    }
  }
}

export default RouteContext
{'fraction_non_alphanumeric': 0.11689145793192036, 'fraction_numerical': 0.006422607578676943, 'mean_word_length': 3.2222222222222223, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5244864', 'n_tokens_mistral': 488, 'n_tokens_neox': 480, 'n_words': 115}