From 079aba636cbe241adcf7cf500eea2b624035bcfb Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Tue, 17 May 2016 18:38:28 -0700 Subject: [PATCH 1/2] If value is deleted from the nav link collection, invalidate cache Otherwise, the next time inOrder is called, the stale nav link collection that is in the cache is returned, with the deleted object still in it. --- src/ui/ui_nav_link_collection.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ui/ui_nav_link_collection.js b/src/ui/ui_nav_link_collection.js index bba26e0e0e6a0..eadcf405198d3 100644 --- a/src/ui/ui_nav_link_collection.js +++ b/src/ui/ui_nav_link_collection.js @@ -26,4 +26,9 @@ export default class UiNavLinkCollection extends Collection { return this[inOrderCache]; } + delete(value) { + super.delete(value); + this[inOrderCache] = null; + } + }; From c2afedac40a8b80a1e0c21386d0b7019e7588578 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Tue, 17 May 2016 18:47:53 -0700 Subject: [PATCH 2/2] Return value of superclass's delete, preserving API --- src/ui/ui_nav_link_collection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/ui_nav_link_collection.js b/src/ui/ui_nav_link_collection.js index eadcf405198d3..dbb3a1830975e 100644 --- a/src/ui/ui_nav_link_collection.js +++ b/src/ui/ui_nav_link_collection.js @@ -27,8 +27,8 @@ export default class UiNavLinkCollection extends Collection { } delete(value) { - super.delete(value); this[inOrderCache] = null; + return super.delete(value); } };