File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed
src/main/ruby/truffleruby/core Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ Bug fixes:
63
63
* Fixed ` printf ` should raise error when not enough arguments for positional argument.
64
64
* Removed "shadowing outer local variable" warning.
65
65
* Fixed parameter conversion to ` String ` in ENV methods.
66
+ * Fixed deprecation warning when ` ENV.index ` is called.
66
67
67
68
Compatibility:
68
69
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -201,19 +201,20 @@ def values_at(*params)
201
201
end
202
202
203
203
def index ( value )
204
- value = StringValue ( value ) ;
205
- each do |k , v |
206
- return k if v == value
207
- end
208
- nil
204
+ warn 'warning: ENV.index is deprecated; use ENV.key'
205
+ key ( value )
209
206
end
210
207
211
208
def invert
212
209
to_hash . invert
213
210
end
214
211
215
212
def key ( value )
216
- index ( value )
213
+ value = StringValue ( value ) ;
214
+ each do |k , v |
215
+ return k if v == value
216
+ end
217
+ nil
217
218
end
218
219
219
220
def keys
@@ -311,7 +312,7 @@ def assoc(key)
311
312
def rassoc ( value )
312
313
value = Truffle ::Type . rb_check_convert_type ( value , String , :to_str )
313
314
return nil if value . nil?
314
- key = index ( value )
315
+ key = key ( value )
315
316
key ? [ key , value ] : nil
316
317
end
317
318
You can’t perform that action at this time.
0 commit comments