File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -96,8 +96,8 @@ def on_abstract_node(node, parent)
96
96
else
97
97
# Run hooks if there are any
98
98
new_node = node
99
- begin_hooks_ok = @visitors . empty? || begin_visit ( new_node , parent )
100
- if begin_hooks_ok
99
+ no_hooks = ! @visitors . key? ( node . class )
100
+ if no_hooks || begin_visit ( new_node , parent )
101
101
node . children . each do |child_node |
102
102
new_child_and_node = on_node_with_modifications ( child_node , new_node )
103
103
# Reassign `node` in case the child hook makes a modification
@@ -106,7 +106,7 @@ def on_abstract_node(node, parent)
106
106
end
107
107
end
108
108
end
109
- @visitors . any? && end_visit ( new_node , parent )
109
+ end_visit ( new_node , parent ) unless no_hooks
110
110
111
111
if new_node . equal? ( node )
112
112
nil
You can’t perform that action at this time.
0 commit comments