-
-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Truffle] Lots of work on STDIN, STDOUT, STDERR.
- 9.4.12.0
- 9.4.11.0
- 9.4.10.0
- 9.4.9.0
- 9.4.8.0
- 9.4.7.0
- 9.4.6.0
- 9.4.5.0
- 9.4.4.0
- 9.4.3.0
- 9.4.2.0
- 9.4.1.0
- 9.4.0.0
- 9.3.15.0
- 9.3.14.0
- 9.3.13.0
- 9.3.12.0
- 9.3.11.0
- 9.3.10.0
- 9.3.9.0
- 9.3.8.0
- 9.3.7.0
- 9.3.6.0
- 9.3.5.0
- 9.3.4.0
- 9.3.3.0
- 9.3.2.0
- 9.3.1.0
- 9.3.0.0
- 9.2.21.0
- 9.2.20.1
- 9.2.20.0
- 9.2.19.0
- 9.2.18.0
- 9.2.17.0
- 9.2.16.0
- 9.2.15.0
- 9.2.14.0
- 9.2.13.0
- 9.2.12.0
- 9.2.11.1
- 9.2.11.0
- 9.2.10.0
- 9.2.9.0
- 9.2.8.0
- 9.2.7.0
- 9.2.6.0
- 9.2.5.0
- 9.2.4.1
- 9.2.4.0
- 9.2.3.0
- 9.2.2.0
- 9.2.1.0
- 9.2.0.0
- 9.1.17.0
- 9.1.16.0
- 9.1.15.0
- 9.1.14.0
- 9.1.13.0
- 9.1.12.0
- 9.1.11.0
- 9.1.10.0
- 9.1.9.0
- 9.1.8.0
- 9.1.7.0
- 9.1.6.0
- 9.1.5.0
- 9.1.4.0
- 9.1.3.0
- 9.1.2.0
- 9.1.1.0
- 9.1.0.0
- 9.0.5.0
- 9.0.4.0
- 9.0.3.0
- 9.0.1.0
- 9.0.0.0
- 9.0.0.0.rc2
- 9.0.0.0.rc1
- 9.0.0.0.pre2
- 9.0.0.0.pre1
1 parent
0755620
commit f16b8f7
Showing
9 changed files
with
156 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
core/src/main/java/org/jruby/truffle/nodes/globals/CheckStdoutVariableTypeNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved. This | ||
* code is released under a tri EPL/GPL/LGPL license. You can use it, | ||
* redistribute it and/or modify it under the terms of the: | ||
* | ||
* Eclipse Public License version 1.0 | ||
* GNU General Public License version 2 | ||
* GNU Lesser General Public License version 2.1 | ||
*/ | ||
package org.jruby.truffle.nodes.globals; | ||
|
||
import com.oracle.truffle.api.CompilerDirectives; | ||
import com.oracle.truffle.api.frame.VirtualFrame; | ||
import com.oracle.truffle.api.source.SourceSection; | ||
import org.jruby.truffle.nodes.RubyNode; | ||
import org.jruby.truffle.runtime.ModuleOperations; | ||
import org.jruby.truffle.runtime.RubyContext; | ||
import org.jruby.truffle.runtime.control.RaiseException; | ||
import org.jruby.truffle.runtime.core.RubyBasicObject; | ||
import org.jruby.truffle.runtime.core.RubyMatchData; | ||
import org.jruby.truffle.runtime.core.RubyNilClass; | ||
|
||
public class CheckStdoutVariableTypeNode extends RubyNode { | ||
|
||
@Child protected RubyNode child; | ||
|
||
public CheckStdoutVariableTypeNode(RubyContext context, SourceSection sourceSection, RubyNode child) { | ||
super(context, sourceSection); | ||
this.child = child; | ||
} | ||
|
||
public Object execute(VirtualFrame frame) { | ||
notDesignedForCompilation(); | ||
|
||
final Object childValue = child.execute(frame); | ||
|
||
if (childValue == getContext().getCoreLibrary().getNilObject() || ModuleOperations.lookupMethod(getContext().getCoreLibrary().getMetaClass(childValue), "write") == null) { | ||
throw new RaiseException(getContext().getCoreLibrary().typeError(String.format("$stdout must have write method, %s given", getContext().getCoreLibrary().getLogicalClass(childValue).getName()), this)); | ||
} | ||
|
||
return childValue; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,35 @@ | ||
fails:Predefined global $~ changes the value of derived capture globals when assigned | ||
fails:Predefined global $~ changes the value of the derived preceding match global | ||
fails:Predefined global $~ changes the value of the derived following match global | ||
fails:Predefined global $~ changes the value of the derived full match global | ||
fails:Predefined global $` is equivalent to MatchData#pre_match on the last match $~ | ||
fails(inherited):Predefined global $` sets an empty result to the encoding of the source String | ||
fails:Predefined global $' is equivalent to MatchData#post_match on the last match $~ | ||
fails(inherited):Global variable $0 raises a TypeError when not given an object that can be coerced to a String | ||
fails(inherited):Predefined global $' sets an empty result to the encoding of the source String | ||
fails:Predefined global $stdout raises TypeError error if assigned to nil | ||
fails:Predefined global $stdout raises TypeError error if assigned to object that doesn't respond to #write | ||
fails:Predefined global $! remains nil after a failed core class "checked" coercion against a class that defines method_missing | ||
fails(inherited):Predefined global $/ changes $-0 | ||
fails:Predefined global $/ does not call #to_str to convert the object to a String | ||
fails:Predefined global $/ raises a TypeError if assigned a Fixnum | ||
fails:Predefined global $/ raises a TypeError if assigned a boolean | ||
fails(inherited):Predefined global $-0 changes $/ | ||
fails(inherited):Predefined global $-0 does not call #to_str to convert the object to a String | ||
fails(inherited):Predefined global $-0 raises a TypeError if assigned a Fixnum | ||
fails(inherited):Predefined global $-0 raises a TypeError if assigned a boolean | ||
fails:Predefined global $, raises TypeError if assigned a non-String | ||
fails:Predefined global $_ is set to the last line read by e.g. StringIO#gets | ||
fails:Predefined global $_ is set at the method-scoped level rather than block-scoped | ||
fails(inherited):Predefined global $-0 raises a TypeError if assigned a Fixnum | ||
fails(inherited):Predefined global $/ changes $-0 | ||
fails(inherited):Predefined global $` sets an empty result to the encoding of the source String | ||
fails:Execution variable $: is the same object as $LOAD_PATH and $-I | ||
fails:Global variable $-d is an alias of $DEBUG | ||
fails:Global variable $-v is an alias of $VERBOSE | ||
fails:Global variable $-w is an alias of $VERBOSE | ||
fails(inherited):Global variable $0 raises a TypeError when not given an object that can be coerced to a String | ||
fails:The predefined standard objects includes ARGF | ||
fails:The predefined global constants includes TOPLEVEL_BINDING | ||
fails:The predefined global constant STDERR has nil for the external encoding despite Encoding.default_external being changed | ||
fails:The predefined global constant STDERR has the encodings set by #set_encoding | ||
fails:The predefined global constant ARGV contains Strings encoded in locale Encoding | ||
fails:The predefined global constant STDERR has nil for the external encoding | ||
fails:The predefined global constant STDOUT has the encodings set by #set_encoding | ||
fails:The predefined global constant STDOUT has nil for the external encoding despite Encoding.default_external being changed | ||
fails:The predefined global constant STDOUT has nil for the external encoding | ||
fails:The predefined global constant STDIN has nil for the internal encoding despite Encoding.default_internal being changed | ||
fails:The predefined global constant STDIN has nil for the internal encoding | ||
fails:The predefined global constant STDIN retains the encoding set by #set_encoding when Encoding.default_external is changed | ||
fails:The predefined global constant STDIN has the encodings set by #set_encoding | ||
fails:The predefined global constant STDIN has the same external encoding as Encoding.default_external when that encoding is changed | ||
fails:The predefined global constant STDIN has the same external encoding as Encoding.default_external | ||
fails:Predefined global $` sets an empty result to the encoding of the source String | ||
fails:Global variable $0 raises a TypeError when not given an object that can be coerced to a String | ||
fails:Predefined global $! remains nil after a failed core class "checked" coercion against a class that defines method_missing | ||
fails:Predefined global $' is equivalent to MatchData#post_match on the last match $~ | ||
fails:Predefined global $' sets an empty result to the encoding of the source String | ||
fails:Predefined global $/ changes $-0 | ||
fails:Predefined global $, raises TypeError if assigned a non-String | ||
fails:Predefined global $-0 changes $/ | ||
fails:Predefined global $-0 does not call #to_str to convert the object to a String | ||
fails:Predefined global $-0 raises a TypeError if assigned a Fixnum | ||
fails:Predefined global $-0 raises a TypeError if assigned a boolean | ||
fails:Global variable $0 raises a TypeError when not given an object that can be coerced to a String | ||
fails:Predefined global $-0 raises a TypeError if assigned a Fixnum | ||
fails:Predefined global $/ changes $-0 | ||
fails:Predefined global $/ does not call #to_str to convert the object to a String | ||
fails:Predefined global $/ raises a TypeError if assigned a boolean | ||
fails:Predefined global $/ raises a TypeError if assigned a Fixnum | ||
fails:Predefined global $_ is set at the method-scoped level rather than block-scoped | ||
fails:Predefined global $_ is set to the last line read by e.g. StringIO#gets | ||
fails:Predefined global $` is equivalent to MatchData#pre_match on the last match $~ | ||
fails:Predefined global $` sets an empty result to the encoding of the source String | ||
fails:Predefined global $~ changes the value of derived capture globals when assigned | ||
fails:Predefined global $~ changes the value of the derived following match global | ||
fails:Predefined global $~ changes the value of the derived full match global | ||
fails:Predefined global $~ changes the value of the derived preceding match global | ||
fails:The predefined global constants includes TOPLEVEL_BINDING | ||
fails:The predefined standard objects includes ARGF |