Skip to content

Commit de3f986

Browse files
committed
List members for String and Symbol
1 parent a0f15a1 commit de3f986

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Bug fixes:
3131
* Fixed missing polyglot type declaration for `RSTRING_PTR` to help with native/managed interop.
3232
* Fixed `Module#to_s` and `Module#inspect` to not return an extra `#<Class:` for singleton classes.
3333
* Arrays backed by native storage now allocate the correct amount of memory (#1828).
34+
* `Truffle::Interop.keys` should report methods of String and Symbol (#1817)
3435

3536
Compatibility:
3637

src/main/ruby/truffleruby/core/truffle/interop.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def self.object_keys(object, internal)
4444
# TODO (pitr-ch 23-May-2019): add assert that called methods are in members list
4545
if object.is_a?(Hash)
4646
keys = object.keys # FIXME (pitr-ch 11-May-2019): no return methods
47-
elsif object.respond_to?(:[]) && !object.is_a?(Array)
47+
elsif object.respond_to?(:[]) && !object.is_a?(Array) && !object.is_a?(String) && !object.is_a?(Symbol)
4848
# FIXME (pitr-ch 11-May-2019): remove the branch
4949
keys = []
5050
else

0 commit comments

Comments
 (0)