Bug 1142115 - remove for/of scoping workaround; r?bgrins draft
authorTom Tromey <tom@tromey.com>
Wed, 31 May 2017 13:00:19 -0600
changeset 588415 f3e7242ab6fbe9df69d516a5030600595df7ea0c
parent 588329 99cc18bf162ac13654adbc515d999e6590cce6dc
child 588416 e4e3a5492cd602595a59b7fed7c4d66e2a4d6a66
push id62026
push userbmo:ttromey@mozilla.com
push dateFri, 02 Jun 2017 19:44:06 +0000
reviewersbgrins
bugs1142115
milestone55.0a1
Bug 1142115 - remove for/of scoping workaround; r?bgrins MozReview-Commit-ID: IVUDJPpshSl
devtools/server/actors/script.js
--- a/devtools/server/actors/script.js
+++ b/devtools/server/actors/script.js
@@ -1956,21 +1956,17 @@ const ThreadActor = ActorClassWithSpec(t
         // this call will replace the previous set of source actors for this source
         // with a new one. If the source actors have not been replaced by the time
         // we try to reset the breakpoints below, their location objects will still
         // point to the old set of source actors, which point to different
         // scripts.
         this.unsafeSynchronize(sourceActorsCreated);
       }
 
-      for (let _actor of bpActors) {
-        // XXX bug 1142115: We do async work in here, so we need to create a fresh
-        // binding because for/of does not yet do that in SpiderMonkey.
-        let actor = _actor;
-
+      for (const actor of bpActors) {
         if (actor.isPending) {
           promises.push(actor.originalLocation.originalSourceActor._setBreakpoint(actor));
         } else {
           promises.push(
             this.sources.getAllGeneratedLocations(actor.originalLocation).then(
               (generatedLocations) => {
                 if (generatedLocations.length > 0 &&
                     generatedLocations[0].generatedSourceActor