Skip to content

Commit

Permalink
[Truffle] Fix usage of flush_stdout on STDOUT to use the public modul…
Browse files Browse the repository at this point in the history
…e method.

* And not the private instance one.
  • Loading branch information
eregon committed Oct 10, 2014
1 parent 467c5e3 commit 527303f
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -320,11 +320,11 @@ public void initialize() {
}

public void initializeAfterMethodsAdded() {
// Just create a dummy object for $stdout - we can use Kernel#print and a special method TruffleDebug#flush_stdout
// Just create a dummy object for $stdout - we can use Kernel#print and a special method TruffleDebug.flush_stdout

final RubyBasicObject stdout = new RubyBasicObject(objectClass);
stdout.getSingletonClass(null).addMethod(null, ModuleOperations.lookupMethod(stdout.getMetaClass(), "print").withNewVisibility(Visibility.PUBLIC));
stdout.getSingletonClass(null).addMethod(null, ModuleOperations.lookupMethod(truffleDebugModule, "flush_stdout").withNewName("flush"));
stdout.getSingletonClass(null).addMethod(null, ModuleOperations.lookupMethod(truffleDebugModule.getSingletonClass(null), "flush_stdout").withNewName("flush"));
globalVariablesObject.setInstanceVariable("$stdout", stdout);

objectClass.setConstant(null, "STDIN", new RubyBasicObject(objectClass));
Expand Down

0 comments on commit 527303f

Please sign in to comment.