 
       if newNode.nodeName == 'SCRIPT' && newNode.getAttribute("data-turbolinks-eval") != "false"
         executeScriptTag(newNode)
-      else
-        refreshedNodes.push(newNode)
-
-  refreshedNodes
 
 executeScriptTags = ->
   scripts = Array::slice.call document.body.querySelectorAll 'script:not([data-turbolinks-eval="false"])'

keepNodes = (targetBody, existingNodes) ->
  for existingNode in existingNodes
    unless nodeId = existingNode.getAttribute('id')
      throw new Error("Turbolinks partial replace: Kept nodes must have an id.")

    if newNode = targetBody.querySelector('[id="'+nodeId+'"]')
      newNode.parentNode.replaceChild(existingNode, newNode)

changeNodes = (targetBody, existingNodes) ->
  parentIsRefreshing = (node) ->
    for potentialParent in existingNodes when node != potentialParent
      return true if potentialParent.contains(node)
    false

  refreshedNodes = []
  for existingNode in existingNodes
    continue if parentIsRefreshing(existingNode)

    unless nodeId = existingNode.getAttribute('id')
      throw new Error "Turbolinks partial replacement: change key elements must have an id."



fetchHistory = (cachedPage) ->
  xhr?.abort()
  changePage createDocument(cachedPage.body.innerHTML), title: cachedPage.title
  progressBar?.done()
  recallScrollPosition cachedPage
  triggerEvent EVENTS.RESTORE
