From c2a42d5d2bcfbe0c7ab48488f29014a44c4c8559 Mon Sep 17 00:00:00 2001 From: Rado Kirov Date: Fri, 8 May 2015 18:45:48 -0700 Subject: [PATCH] fix(location): dartium does not like pushState with null. According to https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history the value of the title parameter is irrelevant anyways. --- modules/angular2/src/router/location.js | 2 +- modules/angular2/test/router/location_spec.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/angular2/src/router/location.js b/modules/angular2/src/router/location.js index 6f9328e5cb..ae5eb37055 100644 --- a/modules/angular2/src/router/location.js +++ b/modules/angular2/src/router/location.js @@ -36,7 +36,7 @@ export class Location { go(url:string) { url = this._stripBaseHref(url); - this._browserLocation.pushState(null, null, url); + this._browserLocation.pushState(null, '', url); } forward() { diff --git a/modules/angular2/test/router/location_spec.js b/modules/angular2/test/router/location_spec.js index e0cd179245..4fef073f94 100644 --- a/modules/angular2/test/router/location_spec.js +++ b/modules/angular2/test/router/location_spec.js @@ -27,14 +27,14 @@ export function main() { it('should normalize urls on navigate', () => { location.go('/my/app/user/btford'); - expect(browserLocation.spy('pushState')).toHaveBeenCalledWith(null, null, '/user/btford'); + expect(browserLocation.spy('pushState')).toHaveBeenCalledWith(null, '', '/user/btford'); }); it('should remove index.html from base href', () => { browserLocation.baseHref = '/my/app/index.html'; location = new Location(browserLocation); location.go('/my/app/user/btford'); - expect(browserLocation.spy('pushState')).toHaveBeenCalledWith(null, null, '/user/btford'); + expect(browserLocation.spy('pushState')).toHaveBeenCalledWith(null, '', '/user/btford'); }); it('should normalize urls on popstate', inject([AsyncTestCompleter], (async) => {