Skip to content

Commit

Permalink
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ public DynamicObject splat(VirtualFrame frame, Object object) {
}

// MRI tries to call dynamic respond_to? here.
Object respondToResult = respondToToA.call(frame, object, "respond_to?", null, Layouts.STRING.createString(getContext().getCoreLibrary().getStringFactory(), StringOperations.encodeByteList(method, UTF8Encoding.INSTANCE), StringSupport.CR_UNKNOWN, null), true);
Object respondToResult = respondToToA.call(frame, object, "respond_to?", null, makeMethodNameString(method), true);
if (respondToResult != DispatchNode.MISSING && respondToCast.executeBoolean(frame, respondToResult)) {
final Object array = toA.call(frame, object, method, null);

@@ -115,4 +115,9 @@ object, getContext().getCoreLibrary().getArrayClass(), method, array, this)
return Layouts.ARRAY.createArray(getContext().getCoreLibrary().getArrayFactory(), new Object[]{object}, 1);
}

@CompilerDirectives.TruffleBoundary
private DynamicObject makeMethodNameString(String methodName) {
return Layouts.STRING.createString(getContext().getCoreLibrary().getStringFactory(), StringOperations.encodeByteList(methodName, UTF8Encoding.INSTANCE), StringSupport.CR_UNKNOWN, null);
}

}

0 comments on commit e139d9c

Please sign in to comment.