anchor.diff:                  
                   selectFrameInfo(el.attributes["data-index"].value);
               };
  -            var replPre = frameInfo.querySelector(".repl pre");
  -            var replInput = frameInfo.querySelector(".repl input");
  -            var replPrompt = frameInfo.querySelector(".repl .prompt span");
  -            if(replInput) {
  -                replInput.onkeydown = function(ev) {
  -                    if(ev.keyCode == 13) {
  -                        // reset the command up/down arrow offset.
  -                        previousCommandOffset = 0;
  -
  -                        var text = replInput.value;
  -
  -                        if(text != "" && text !== undefined) {
  -                            // push this command on to the previous commands list.
  -                            previousCommands.push(text);
  -                        }
  -
  -                        replInput.value = "";
  -                        apiCall("eval", { "index": index, source: text }, function(response) {
  -                            replPre.innerHTML += replPrompt.innerHTML + " " + response.highlighted_input + "\n";
  -                            if(response.error) {
  -                                replPre.innerHTML += "<span class='error'>" + escapeHTML(response.error) + "</span>\n";
  -                            } else {
  -                                replPre.innerHTML += escapeHTML(response.result);
  -                                replPrompt.innerHTML = escapeHTML(response.prompt);
  -                            }
  -                            replPre.scrollTop = replPre.scrollHeight;
  -                        });
  -                    } else if(ev.keyCode == 38) {
  -                        // the user pressed the up arrow.
  -                        populateCommandPrompt(replInput, previousCommandOffset - 1, -1);
  -                        return false;
  -                    } else if(ev.keyCode == 40) {
  -                        // the user pressed the down arrow.
  -                        populateCommandPrompt(replInput, previousCommandOffset + 1, previousCommands.length);
  -                        return false;
  -                    }
  -                };
  +            var repl = frameInfo.querySelector(".repl .console");
  +            if(repl) {
  +                new REPL(index).install(repl);
               }
           })(i, frames[i], frameInfos[i]);
       }
  
positive.code:             replInput.focus();
          }
      }
  
      function populateCommandPrompt(input, newOffset, bound) {
          var index = previousCommands.length + newOffset;
          var previousCommand;
  
          if(index < previousCommands.length && index >= 0) {
              // the new index is within the bounds of the 
              // commands array, so grab the previously
              // entered command.
              previousCommandOffset = newOffset;
              previousCommand = previousCommands[index];
          }else{
              // the new index isn't within the bounds
              // of the array.
              previousCommand = "";
  
              if(index == bound) {
                  // set the offset just outside only
                  // if we're at the bounds of the array.
                  // this is so we only get one 'blank' 
                  // command and don't continue moving
                  // the offset when we shouldn't. 
                  previousCommandOffset = newOffset;
              }
          }
          // now set the input's text to the previous command
          // in the list. 
          input.value = previousCommand; 
          
          INPUT = input;
          if(input.setSelectionRange) {
              // set cursor to end of input
              var pos = previousCommand.length;
              input.setSelectionRange(pos, pos);
          }
      }
      
      for(var i = 0; i < frames.length; i++) {
          (function(index, el, frameInfo) {
  
negative.code: </body>
  <script>
  (function() {
      var OID = <%== object_id.to_s.inspect %>;
      
      var previous = null;
      var previousFrameInfo = null;
      var frames = document.querySelectorAll("ul.frames li");
      var frameInfos = document.querySelectorAll(".frame_info");
  
      function apiCall(method, opts, cb) {
          var req = new XMLHttpRequest();
          req.open("POST", "/__better_errors/" + OID + "/" + method, true);
          req.setRequestHeader("Content-Type", "application/json");
          req.send(JSON.stringify(opts));
          req.onreadystatechange = function() {
  