   for prop in ["hash", "host", "hostname", "pathname", "port", "protocol", "search"]
     do (prop)=>
       @prototype.__defineGetter__ prop, ->
-        @_url?[prop] || ""
+        @_history.current?[prop] || ""
       @prototype.__defineSetter__ prop, (value)->
-        newUrl = URL.parse(@_url?.href)
+        newUrl = URL.parse(@_history.current?.href)
         newUrl[prop] = value
         @_history._assign URL.format(newUrl)
 

#
# Represents window.location and document.location.
class Location
  constructor: (@_history, @_url)->

  # ### location.assign(url)
  assign: (newUrl)->


  # ### location.toString() => String
  toString: ->
    return URL.format(@_history.current)

  # ### location.href => String
  @prototype.__defineGetter__ "href", ->
    return @_history.current?.href

  # ### location.href = url
  @prototype.__defineSetter__ "href", (new_url)->
