<commit_before>'use strict'
var DropdownPanel = require('./DropdownPanel')
var remixLib = require('remix-lib')
var ui = remixLib.helpers.ui
var yo = require('yo-yo')

function StackPanel (_parent, _traceManager) {
  this.parent = _parent
  this.traceManager = _traceManager
  this.basicPanel = new DropdownPanel('Stack', {json: true})
  this.init()
}

StackPanel.prototype.render = function () {
  return yo`<div id='stackpanel' >${this.basicPanel.render()}</div>`
}

StackPanel.prototype.init = function () {
  var self = this
  this.parent.event.register('indexChanged', this, function (index) {
    if (index < 0) return
    if (self.parent.currentStepIndex !== index) return

    self.traceManager.getStackAt(index, function (error, stack) {
      if (error) {
        self.basicPanel.update({})
        console.log(error)
      } else if (self.parent.currentStepIndex === index) {
        self.basicPanel.update(self.format(stack))
      }
    })
  })
}

StackPanel.prototype.format = function (stack) {
  var ret = []
  stack.map(function (item, i) {
    var hex = ui.normalizeHex(item)
    ret.push(hex)
  })
  return ret
}

module.exports = StackPanel<commit_msg>display raw value in former debugger<commit_after>'use strict'
var DropdownPanel = require('./DropdownPanel')
var yo = require('yo-yo')

function StackPanel (_parent, _traceManager) {
  this.parent = _parent
  this.traceManager = _traceManager
  this.basicPanel = new DropdownPanel('Stack', {json: true})
  this.init()
}

StackPanel.prototype.render = function () {
  return yo`<div id='stackpanel' >${this.basicPanel.render()}</div>`
}

StackPanel.prototype.init = function () {
  var self = this
  this.parent.event.register('indexChanged', this, function (index) {
    if (index < 0) return
    if (self.parent.currentStepIndex !== index) return

    self.traceManager.getStackAt(index, function (error, stack) {
      if (error) {
        self.basicPanel.update({})
        console.log(error)
      } else if (self.parent.currentStepIndex === index) {
        self.basicPanel.update(stack)
      }
    })
  })
}

module.exports = StackPanel
{'fraction_non_alphanumeric': 0.14326241134751774, 'fraction_numerical': 0.0009456264775413711, 'mean_word_length': 3.6814159292035398, 'pattern_counts': {'":': 0, '<': 9, '<?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': '4380311', 'n_tokens_mistral': 670, 'n_tokens_neox': 664, 'n_words': 144}