emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 31/46: js2-mode-find-enclosing-node: Make docstring and impl cons


From: Dmitry Gutov
Subject: [elpa] 31/46: js2-mode-find-enclosing-node: Make docstring and impl consistent with name
Date: Sat, 15 Nov 2014 20:58:08 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit e703d4fc885f7259e9a492e71193c29a61bfd6be
Author: Leo Liu <address@hidden>
Date:   Fri Oct 31 04:07:16 2014 +0300

    js2-mode-find-enclosing-node: Make docstring and impl consistent with name
    
    Closes #170
---
 js2-mode.el |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/js2-mode.el b/js2-mode.el
index 0ba16c9..e5683a2 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -4547,16 +4547,16 @@ Returns nil if NODE is not inside a function."
       (setq node (js2-node-parent node)))
     node))
 
-(defun js2-mode-find-enclosing-node (beg end)
-  "Find script or function fully enclosing BEG and END."
+ (defun js2-mode-find-enclosing-node (beg end)
+  "Find node fully enclosing BEG and END."
   (let ((node (js2-node-at-point beg))
         pos
         (continue t))
     (while continue
       (if (or (js2-ast-root-p node)
-              (and (js2-function-node-p node)
-                   (<= (setq pos (js2-node-abs-pos node)) beg)
-                   (>= (+ pos (js2-node-len node)) end)))
+              (and
+               (<= (setq pos (js2-node-abs-pos node)) beg)
+               (>= (+ pos (js2-node-len node)) end)))
           (setq continue nil)
         (setq node (js2-node-parent node))))
     node))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]