   pageCacheKeys = Object.keys pageCache
 
   cacheTimesRecentFirst = pageCacheKeys.map (url) ->
-    pageCache[url].cachedAtn
+    pageCache[url].cachedAt
   .sort (a, b) -> b - a
 
   for key in pageCacheKeys when pageCache[key].cachedAt <= cacheTimesRecentFirst[limit]

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."



      if newNode.nodeName == 'SCRIPT' && newNode.getAttribute("data-turbolinks-eval") != "false"
        executeScriptTag(newNode)

executeScriptTags = ->
  scripts = Array::slice.call document.body.querySelectorAll 'script:not([data-turbolinks-eval="false"])'
