       triggerEvent("page:#{name}-error", event) if event.type == 'error'
       newNode.removeEventListener('load', onAssetEvent)
       newNode.removeEventListener('error', onAssetEvent)
-      done()
+      done() if typeof done == 'function'
     newNode.addEventListener('load', onAssetEvent)
     newNode.addEventListener('error', onAssetEvent)
     activeDocument.head.appendChild(newNode)

      trackName != 'true'
    )

updateLinkTags = (activeDocument, newLinks, callback) ->
  # style tag load events don't work in all browsers
  # as such we just hope they load ¯\_(ツ)_/¯
  newLinks.forEach((linkNode) -> insertLinkTask(activeDocument, linkNode)(noOp))
  callback()

updateScriptTags = (activeDocument, newScripts, callback) ->
  asyncSeries(

    if newScripts.concat(newLinks).some(hasAssetConflicts(activeAssets))
      return failureCallback()

    updateLinkTags(@activeDocument, newLinks)
    updateScriptTags(@activeDocument, newScripts, successCallback)

extractTrackedAssets = (doc) ->
  [].slice.call(doc.querySelectorAll('[data-turbolinks-track]'))
