]> code.delx.au - gnu-emacs-elpa/commitdiff
Revert "don't use inner scope of `for` for iteration target."
authormooz <stillpedant@gmail.com>
Mon, 28 Mar 2011 15:00:25 +0000 (00:00 +0900)
committermooz <stillpedant@gmail.com>
Mon, 28 Mar 2011 15:00:25 +0000 (00:00 +0900)
This reverts commit 09a9e5e94c7175535e525d9f0645b1e4fc7bd404.

js2-mode.el

index 6e558f44e7a44d9922cae4c12a83d091548ac75b..2a667d7ea00c968bf205a3f79e7af3526f5e510f 100644 (file)
@@ -7229,10 +7229,10 @@ Returns t on match, nil if no match."
   (unless js2-compiler-xml-available
     (js2-report-error "msg.XML.not.available")))
 
-(defsubst js2-push-scope (scope &optional overwrite-parent)
+(defsubst js2-push-scope (scope)
   "Push SCOPE, a `js2-scope', onto the lexical scope chain."
   (assert (js2-scope-p scope))
-  (or overwrite-parent (assert (null (js2-scope-parent-scope scope))))
+  (assert (null (js2-scope-parent-scope scope)))
   (assert (not (eq js2-current-scope scope)))
   (setf (js2-scope-parent-scope scope) js2-current-scope
         js2-current-scope scope))
@@ -7924,13 +7924,7 @@ Parses for, for-in, and for each-in statements."
       (if (js2-match-token js2-IN)
           (setq is-for-in t
                 in-pos (- js2-token-beg for-pos)
-                cond (let ((for-body-scope js2-current-scope))
-                       ;; scope of iteration target object is not the scope we've created above.
-                       ;; stash current scope temporary.
-                       (js2-pop-scope)
-                       (unwind-protect
-                           (js2-parse-expr) ; object over which we're iterating
-                         (js2-push-scope for-body-scope t))))
+                cond (js2-parse-expr))  ; object over which we're iterating
         ;; else ordinary for loop - parse cond and incr
         (js2-must-match js2-SEMI "msg.no.semi.for")
         (setq cond (if (= (js2-peek-token) js2-SEMI)