Bug 1141418 - Fix index after calling splice while iterating remoteFrames array. r=jgriffin, a=jocheng
authorTing-Yu Chou <janus926@gmail.com>
Tue, 19 May 2015 11:49:11 +0800
changeset 238452 dfa13a52285be12366bb7e345565fe5221e8b81b
parent 238451 48d3ed44bafd79e63d4689c200b6b251698698e2
child 238453 79de851d35d4594c20bfd27a4d8ef60b76e61c5a
push id627
push userryanvm@gmail.com
push dateThu, 21 May 2015 14:23:39 +0000
treeherdermozilla-b2g37_v2_2@dfa13a52285b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgriffin, jocheng
bugs1141418
milestone37.0
Bug 1141418 - Fix index after calling splice while iterating remoteFrames array. r=jgriffin, a=jocheng
testing/marionette/marionette-frame-manager.js
--- a/testing/marionette/marionette-frame-manager.js
+++ b/testing/marionette/marionette-frame-manager.js
@@ -115,17 +115,17 @@ FrameManager.prototype = {
       let frameMessageManager = frame.messageManager.get();
       logger.info("trying remote frame " + i);
       try {
         frameMessageManager.sendAsyncMessage("aliveCheck", {});
       }
       catch(e) {
         if (e.result ==  Components.results.NS_ERROR_NOT_INITIALIZED) {
           logger.info("deleting frame");
-          remoteFrames.splice(i, 1);
+          remoteFrames.splice(i--, 1);
           continue;
         }
       }
       if (frameMessageManager == mm) {
         this.currentRemoteFrame = frame;
         this.addMessageManagerListeners(mm);
         if (!frame.specialPowersObserver) {
           frame.specialPowersObserver = new specialpowers.SpecialPowersObserver();