Browse files

pushState/replaceState should not fail if called without URL

  • Loading branch information...
1 parent 59caefa commit 5211c2598c3d03d28624476ed6dda8d9e0c13d8f @assaf committed Sep 20, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/zombie/history.coffee
View
2 lib/zombie/history.coffee
@@ -252,13 +252,15 @@ class History
# This method is available from Location.
pushState: (state, title, url)->
+ url ||= @current.window.location.href
url = HTML.resourceLoader.resolve(@current.window.document, url)
# TODO: check same origin
@addEntry(@current.window, url, state || {})
return
# This method is available from Location.
replaceState: (state, title, url)->
+ url ||= @current.window.location.href
url = HTML.resourceLoader.resolve(@current.window.document, url)
# TODO: check same origin
@replaceEntry(@current.window, url, state || {})

0 comments on commit 5211c25

Please sign in to comment.