From 180a77e671dce13272c13102af40b2b1c46592c9 Mon Sep 17 00:00:00 2001 From: liusy182 Date: Thu, 8 Sep 2016 21:31:42 +0800 Subject: [PATCH 1/2] fix a minor bug in navigation-controller where a string is used as an object --- lib/browser/api/navigation-controller.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/browser/api/navigation-controller.js b/lib/browser/api/navigation-controller.js index 1260cfb3dac..bda8474d893 100644 --- a/lib/browser/api/navigation-controller.js +++ b/lib/browser/api/navigation-controller.js @@ -49,9 +49,10 @@ var NavigationController = (function () { // Normal navigation. Clear history. this.history = this.history.slice(0, this.currentIndex + 1) currentEntry = this.history[this.currentIndex] - if ((currentEntry != null ? currentEntry.url : void 0) !== url) { + + if ((currentEntry != null ? currentEntry : void 0) !== url) { this.currentIndex++ - return this.history.push(url) + this.history.push(url) } } }) From 2c7690be45d5ba99922d5a5102e75c7c42dfcce3 Mon Sep 17 00:00:00 2001 From: liusy182 Date: Thu, 8 Sep 2016 21:36:39 +0800 Subject: [PATCH 2/2] simplify logic --- lib/browser/api/navigation-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/browser/api/navigation-controller.js b/lib/browser/api/navigation-controller.js index bda8474d893..f0b1cef9bb3 100644 --- a/lib/browser/api/navigation-controller.js +++ b/lib/browser/api/navigation-controller.js @@ -50,7 +50,7 @@ var NavigationController = (function () { this.history = this.history.slice(0, this.currentIndex + 1) currentEntry = this.history[this.currentIndex] - if ((currentEntry != null ? currentEntry : void 0) !== url) { + if (currentEntry !== url) { this.currentIndex++ this.history.push(url) }