js/libs/ember-1.5.1.js
function (options) {
      if (options && options.rootURL) {
        Ember.assert('rootURL must end with a trailing forward slash e.g. "/app/"', options.rootURL.charAt(options.rootURL.length-1) === '/');
        this.rootURL = options.rootURL;
      }

      var historyPath, hashPath,
          cancelRouterSetup = false,
          implementationClass = this._NoneLocation,
          currentPath = this._getFullPath();

      if (this._getSupportsHistory()) {
        historyPath = this._getHistoryPath();

        // Since we support history paths, let's be sure we're using them else
        // switch the location over to it.
        if (currentPath === historyPath) {
          implementationClass = this._HistoryLocation;
        } else {
          cancelRouterSetup = true;
          this._replacePath(historyPath);
        }

      } else if (this._getSupportsHashChange()) {
        hashPath = this._getHashPath();

        // Be sure we're using a hashed path, otherwise let's switch over it to so
        // we start off clean and consistent. We'll count an index path with no
        // hash as "good enough" as well.
        if (currentPath === hashPath || (currentPath === '/' && hashPath === '/#/')) {
          implementationClass = this._HashLocation;
        } else {
          // Our URL isn't in the expected hash-supported format, so we want to
          // cancel the router setup and replace the URL to start off clean
          cancelRouterSetup = true;
          this._replacePath(hashPath);
        }
      }

      var implementation = implementationClass.create.apply(implementationClass, arguments);

      if (cancelRouterSetup) {
        set(implementation, 'cancelRouterSetup', true);
      }

      return implementation;
    }
function (options) {
      if (options && options.rootURL) {
        Ember.assert('rootURL must end with a trailing forward slash e.g. "/app/"', options.rootURL.charAt(options.rootURL.length-1) === '/');
        this.rootURL = options.rootURL;
      }

      var historyPath, hashPath,
          cancelRouterSetup = false,
          implementationClass = this._NoneLocation,
          currentPath = this._getFullPath();

      if (this._getSupportsHistory()) {
        historyPath = this._getHistoryPath();

        // Since we support history paths, let's be sure we're using them else
        // switch the location over to it.
        if (currentPath === historyPath) {
          implementationClass = this._HistoryLocation;
        } else {
          cancelRouterSetup = true;
          this._replacePath(historyPath);
        }

      } else if (this._getSupportsHashChange()) {
        hashPath = this._getHashPath();

        // Be sure we're using a hashed path, otherwise let's switch over it to so
        // we start off clean and consistent. We'll count an index path with no
        // hash as "good enough" as well.
        if (currentPath === hashPath || (currentPath === '/' && hashPath === '/#/')) {
          implementationClass = this._HashLocation;
        } else {
          // Our URL isn't in the expected hash-supported format, so we want to
          // cancel the router setup and replace the URL to start off clean
          cancelRouterSetup = true;
          this._replacePath(hashPath);
        }
      }

      var implementation = implementationClass.create.apply(implementationClass, arguments);

      if (cancelRouterSetup) {
        set(implementation, 'cancelRouterSetup', true);
      }

      return implementation;
    }
Selects the best location option based off browser support and returns an
instance of that Location class.

@see Ember.AutoLocation
@method create