Skip to content

Commit

Permalink
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.backtrace.Backtrace;
import org.jruby.truffle.runtime.core.RubyArray;
import org.jruby.truffle.runtime.core.RubyHash;
import org.jruby.truffle.runtime.core.RubyNilClass;
import org.jruby.truffle.runtime.core.RubyString;

@@ -119,7 +120,7 @@ public StorageClassNode(StorageClassNode prev) {
}

@Specialization
public RubyString javaClassOf(RubyArray array) {
public RubyString storageClass(RubyArray array) {
notDesignedForCompilation();

if (array.getStore() == null) {
@@ -129,6 +130,17 @@ public RubyString javaClassOf(RubyArray array) {
}
}

@Specialization
public RubyString storageClass(RubyHash hash) {
notDesignedForCompilation();

if (hash.getStore() == null) {
return getContext().makeString("null");
} else {
return getContext().makeString(hash.getStore().getClass().getName());
}
}

}

@CoreMethod(names = "panic", onSingleton = true)

0 comments on commit 667e30f

Please sign in to comment.