@@ -59,21 +59,7 @@ def self.cruby_locals(source)
59
59
stack = [ ISeq . new ( RubyVM ::InstructionSequence . compile ( source ) . to_a ) ]
60
60
61
61
while ( iseq = stack . pop )
62
- names = [ *iseq . local_table ]
63
- names . map! . with_index do |name , index |
64
- # When an anonymous local variable is present in the iseq's local
65
- # table, it is represented as the stack offset from the top.
66
- # However, when these are dumped to binary and read back in, they
67
- # are replaced with the symbol :#arg_rest. To consistently handle
68
- # this, we replace them here with their index.
69
- if name == :"#arg_rest"
70
- names . length - index + 1
71
- else
72
- name
73
- end
74
- end
75
-
76
- locals << names
62
+ locals << iseq . local_table
77
63
iseq . each_child { |child | stack << child }
78
64
end
79
65
@@ -141,7 +127,7 @@ def self.prism_locals(source)
141
127
sorted << AnonymousLocal if params . keywords . any?
142
128
143
129
if params . keyword_rest . is_a? ( ForwardingParameterNode )
144
- sorted . push ( :* , :& , :"..." )
130
+ sorted . push ( :* , :** , : &, :"..." )
145
131
elsif params . keyword_rest . is_a? ( KeywordRestParameterNode )
146
132
sorted << params . keyword_rest . name if params . keyword_rest . name
147
133
end
0 commit comments