Skip to content

Commit

Permalink
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -78,13 +78,17 @@ public abstract class StringNodes {
@CoreMethod(names = "allocate", constructor = true)
public abstract static class AllocateNode extends CoreMethodArrayArgumentsNode {

@Child private AllocateObjectNode allocateNode;

public AllocateNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
allocateNode = AllocateObjectNodeGen.create(context, sourceSection, null, null);
}

@TruffleBoundary
@Specialization
public DynamicObject allocate(DynamicObject rubyClass) {
return Layouts.STRING.createString(Layouts.CLASS.getInstanceFactory(rubyClass), new ByteList(), StringSupport.CR_UNKNOWN, null);
return allocateNode.allocate(rubyClass, new ByteList(), StringSupport.CR_UNKNOWN, null);
}

}

0 comments on commit 30b4387

Please sign in to comment.