Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
119 additions
and 106 deletions.
- +23 −44 core/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
- +10 −6 core/src/main/ruby/jruby/truffle/core.rb
- +5 −1 core/src/main/ruby/jruby/truffle/core/rubinius/README.md
- +33 −0 core/src/main/ruby/jruby/truffle/core/rubinius/api/compat/type.rb
- 0 core/src/main/ruby/jruby/truffle/core/rubinius/api/{ → kernel}/bootstrap/channel.rb
- 0 core/src/main/ruby/jruby/truffle/core/rubinius/api/{ → kernel}/common/bytearray.rb
- 0 core/src/main/ruby/jruby/truffle/core/rubinius/api/{ → kernel}/common/channel.rb
- 0 core/src/main/ruby/jruby/truffle/core/rubinius/api/{ → kernel}/common/thread.rb
- 0 core/src/main/ruby/jruby/truffle/core/rubinius/api/{ → kernel}/common/tuple.rb
- +0 −3 core/src/main/ruby/jruby/truffle/core/rubinius/api/{ → kernel}/common/type.rb
- +46 −0 core/src/main/ruby/jruby/truffle/core/rubinius/kernel/common/kernel.rb
- +1 −0 core/src/main/ruby/jruby/truffle/core/rubinius/kernel/common/struct.rb
- +0 −2 spec/truffle/tags/core/struct/each_pair_tags.txt
- +0 −2 spec/truffle/tags/core/struct/each_tags.txt
- +0 −4 spec/truffle/tags/core/struct/element_reference_tags.txt
- +0 −1 spec/truffle/tags/core/struct/element_set_tags.txt
- +0 −1 spec/truffle/tags/core/struct/eql_tags.txt
- +0 −2 spec/truffle/tags/core/struct/hash_tags.txt
- +0 −2 spec/truffle/tags/core/struct/initialize_tags.txt
- +0 −1 spec/truffle/tags/core/struct/instance_variables_tags.txt
- +0 −2 spec/truffle/tags/core/struct/length_tags.txt
- +0 −2 spec/truffle/tags/core/struct/members_tags.txt
- +0 −9 spec/truffle/tags/core/struct/new_tags.txt
- +0 −4 spec/truffle/tags/core/struct/select_tags.txt
- +0 −2 spec/truffle/tags/core/struct/size_tags.txt
- +0 −4 spec/truffle/tags/core/struct/struct_tags.txt
- +0 −2 spec/truffle/tags/core/struct/tms/cstime_tags.txt
- +0 −2 spec/truffle/tags/core/struct/tms/cutime_tags.txt
- +0 −1 spec/truffle/tags/core/struct/tms/element_reference_tags.txt
- +0 −1 spec/truffle/tags/core/struct/tms/members_tags.txt
- +0 −1 spec/truffle/tags/core/struct/tms/new_tags.txt
- +0 −2 spec/truffle/tags/core/struct/tms/stime_tags.txt
- +0 −2 spec/truffle/tags/core/struct/tms/utime_tags.txt
- +0 −2 spec/truffle/tags/core/struct/to_a_tags.txt
- +0 −1 spec/truffle/tags/core/struct/values_tags.txt
- +1 −0 spec/truffle/truffle.mspec
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
@@ -0,0 +1,33 @@ | ||
# Copyright (c) 2011, Evan Phoenix | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# | ||
# * Redistributions of source code must retain the above copyright notice, this | ||
# list of conditions and the following disclaimer. | ||
# * Redistributions in binary form must reproduce the above copyright notice | ||
# this list of conditions and the following disclaimer in the documentation | ||
# and/or other materials provided with the distribution. | ||
# * Neither the name of the Evan Phoenix nor the names of its contributors | ||
# may be used to endorse or promote products derived from this software | ||
# without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE | ||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
module Rubinius | ||
module Type | ||
def self.object_kind_of?(obj, cls) | ||
obj.class <= cls | ||
end | ||
end | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,46 @@ | ||
# Copyright (c) 2007-2014, Evan Phoenix and contributors | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# | ||
# * Redistributions of source code must retain the above copyright notice, this | ||
# list of conditions and the following disclaimer. | ||
# * Redistributions in binary form must reproduce the above copyright notice | ||
# this list of conditions and the following disclaimer in the documentation | ||
# and/or other materials provided with the distribution. | ||
# * Neither the name of Rubinius nor the names of its contributors | ||
# may be used to endorse or promote products derived from this software | ||
# without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE | ||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
module Kernel | ||
|
||
## | ||
# MRI uses a macro named StringValue which has essentially the same | ||
# semantics as obj.coerce_to(String, :to_str), but rather than using that | ||
# long construction everywhere, we define a private method similar to | ||
# String(). | ||
# | ||
# Another possibility would be to change String() as follows: | ||
# | ||
# String(obj, sym=:to_s) | ||
# | ||
# and use String(obj, :to_str) instead of StringValue(obj) | ||
|
||
def StringValue(obj) | ||
Rubinius::Type.coerce_to obj, String, :to_str | ||
end | ||
module_function :StringValue | ||
|
||
end |
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
@@ -35,6 +35,7 @@ def self.new(klass_name, *attrs, &block) | ||
if klass_name | ||
begin | ||
klass_name = StringValue klass_name | ||
p klass_name | ||
rescue TypeError | ||
attrs.unshift klass_name | ||
klass_name = nil | ||
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,4 +1,2 @@ | ||
fails:Struct#each_pair returns self if passed a block | ||
fails:Struct#each_pair returns an Enumerator if not passed a block | ||
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,4 +1,2 @@ | ||
fails:Struct#each returns self if passed a block | ||
fails:Struct#each returns an Enumerator if not passed a block | ||
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,6 +1,2 @@ | ||
fails:Struct#[] fails when it does not know about the requested attribute | ||
fails:Struct#[] fails if not passed a string, symbol, or integer | ||
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,2 +1 @@ | ||
fails:Struct#[]= fails when trying to assign attributes which don't exist |
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,5 +1,3 @@ | ||
fails:Struct#hash returns the same fixnum for structs with the same content | ||
fails:Struct#hash returns the same value if structs are #eql? | ||
fails:Struct#hash returns the same hash for recursive structs | ||
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,4 +1,2 @@ | ||
fails:Struct#initialize does nothing when passed a set of fields equal to self | ||
fails:Struct#initialize explicitly sets instance variables to nil when args not provided to initialize | ||
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,2 +1 @@ | ||
fails:Struct#instance_variables returns an array with one name if an instance variable is added |
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,15 +1,6 @@ | ||
fails:Struct.new creates a constant in Struct namespace with string as first argument | ||
fails:Struct.new calls to_str on its first argument (constant name) | ||
fails:Struct.new creates a new anonymous class with nil first argument | ||
fails:Struct.new creates a new anonymous class with symbol arguments | ||
fails:Struct.new fails with invalid constant name as first argument | ||
fails:Struct.new processes passed block with instance_eval | ||
Oops, something went wrong.