Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
156 additions
and 58 deletions.
- +12 −1 core/src/main/java/org/jruby/truffle/nodes/core/ArrayBuilderNode.java
- +3 −2 core/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java
- +8 −4 core/src/main/java/org/jruby/truffle/nodes/core/EncodingNodes.java
- +2 −1 core/src/main/java/org/jruby/truffle/nodes/core/StringNodes.java
- +44 −0 core/src/main/java/org/jruby/truffle/nodes/globals/CheckStdoutVariableTypeNode.java
- +0 −10 core/src/main/java/org/jruby/truffle/runtime/core/CoreLibrary.java
- +5 −0 core/src/main/java/org/jruby/truffle/translator/BodyTranslator.java
- +59 −2 core/src/main/ruby/jruby/truffle/core/kernel.rb
- +23 −38 spec/truffle/tags/language/predefined_tags.txt
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
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
@@ -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
@@ -1,50 +1,35 @@ | ||
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(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 boolean | ||
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: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 $, 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 boolean | ||
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 |