jsinstrument 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -54,10 +54,10 @@ module JSInstrument
54
54
  # instrument only if we can get the line no. and we haven't instrumented it
55
55
  #
56
56
  if line and not instrumented_lines.member? line
57
- if node_classname in ['ExpressionStatement', 'EmptyStatement', 'DoWhile', 'While', 'For',
58
- 'ForIn', 'Continue', 'VarDecl', 'Switch', 'Break', 'Throw', 'Return', 'If', 'VarStatement']
57
+ if ['ExpressionStatement', 'EmptyStatement', 'DoWhile', 'While', 'For', 'ForIn', 'Continue',
58
+ 'VarDecl', 'Switch', 'Break', 'Throw', 'Return', 'If', 'VarStatement'].index node_classname
59
59
 
60
- if parent_classname == 'DoWhile'
60
+ if 'DoWhile' == parent_classname
61
61
  if parent.left.eql? node
62
62
  instrumented_lines.add line
63
63
  parent.left = get_inserted_block node
@@ -65,7 +65,7 @@ module JSInstrument
65
65
  # in RKelly, ConditionalNode extends IfNode
66
66
  # which is so annoying
67
67
  # I mean why they mix a expression and a statement?
68
- elsif parent_classname in ['If', 'While', 'For', 'ForIn', 'With']
68
+ elsif ['If', 'While', 'For', 'ForIn', 'With'].index parent_classname
69
69
  if parent.value.eql? node
70
70
  instrumented_lines.add line
71
71
  parent.value = get_inserted_block node
@@ -73,20 +73,20 @@ module JSInstrument
73
73
  instrumented_lines.add line
74
74
  parent.else = get_inserted_block node
75
75
  end
76
- elsif parent_classname in ['CaseBlock', 'Label']
76
+ elsif ['CaseBlock', 'Label'].index parent_classname
77
77
  # do nothing here
78
- elsif parent_classname == 'SourceElements'
78
+ elsif 'SourceElements' == parent_classname
79
79
  if insert_func_before node
80
80
  instrumented_lines.add line
81
81
  end
82
82
  end
83
- elsif node_classname in ['With', 'Try']
84
- if parent_classname == 'SourceElements'
83
+ elsif ['With', 'Try'].index node_classname
84
+ if 'SourceElements' == parent_classname
85
85
  if insert_func_before node
86
86
  instrumented_lines.add line
87
87
  end
88
88
  end
89
- elsif node_classname in ['FunctionDecl', 'FunctionExpr']
89
+ elsif ['FunctionDecl', 'FunctionExpr'].index node_classname
90
90
  if insert_func_before node
91
91
  instrumented_lines.add line
92
92
  end
@@ -1,3 +1,3 @@
1
1
  module JSInstrument
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
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.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: