jsinstrument 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,7 +41,6 @@ module JSInstrument
41
41
  (inserting % bindings) + instrumented_src
42
42
  end
43
43
 
44
- private
45
44
  def instrument_ast ast
46
45
  # build parent attr for all nodes in ast
47
46
  #
@@ -64,8 +63,11 @@ module JSInstrument
64
63
  instrumented_lines.add line
65
64
  parent.left = get_inserted_block node
66
65
  end
67
- elsif IfNode === parent or WhileNode === parent or
68
- ForNode === parent or ForInNode === parent or WithNode === parent
66
+ # in RKelly, ConditionalNode extends IfNode
67
+ # which is so annoying
68
+ # I mean why they mix a expression and a statement?
69
+ elsif (IfNode === parent and not ConditionalNode === parent) or
70
+ WhileNode === parent or ForNode === parent or ForInNode === parent or WithNode === parent
69
71
  if parent.value.eql? node
70
72
  instrumented_lines.add line
71
73
  parent.value = get_inserted_block node
@@ -96,6 +98,7 @@ module JSInstrument
96
98
  [ast, instrumented_lines.sort]
97
99
  end
98
100
 
101
+ private
99
102
  def get_insert_func_call line
100
103
  ExpressionStatementNode.new(
101
104
  FunctionCallNode.new(
@@ -1,3 +1,3 @@
1
1
  module JSInstrument
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsinstrument
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: