Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opal/opal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 650977b2df3e
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f7567d664c20
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Apr 29, 2015

  1. Copy the full SHA
    d6e6c81 View commit details
  2. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    16ff134 View commit details
  3. Merge pull request #819 from vais/kernel-string

    Kernel#String fully compliant with rubyspec (minus crazy meta :to_s specs)
    elia committed Apr 29, 2015
    Copy the full SHA
    f7567d6 View commit details
Showing with 13 additions and 1 deletion.
  1. +2 −1 opal/corelib/kernel.rb
  2. +9 −0 spec/filters/bugs/kernel.rb
  3. +1 −0 spec/filters/unsupported/private_methods.rb
  4. +1 −0 spec/rubyspecs
3 changes: 2 additions & 1 deletion opal/corelib/kernel.rb
Original file line number Diff line number Diff line change
@@ -1067,7 +1067,8 @@ def singleton_class
alias srand rand

def String(str)
`String(str)`
Opal.coerce_to?(str, String, :to_str) ||
Opal.coerce_to!(str, String, :to_s)
end

def taint
9 changes: 9 additions & 0 deletions spec/filters/bugs/kernel.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
opal_filter "Kernel" do
fails "Kernel.Array does not call #to_a on an Array" #something funky with the spec itself
fails "Kernel#Array does not call #to_a on an Array" #something funky with the spec itself

fails "Kernel.String raises a TypeError if #to_s does not exist"
fails "Kernel.String raises a TypeError if respond_to? returns false for #to_s"
fails "Kernel.String raises a TypeError if #to_s is not defined, even though #respond_to?(:to_s) returns true"
fails "Kernel.String calls #to_s if #respond_to?(:to_s) returns true"
fails "Kernel#String raises a TypeError if #to_s does not exist"
fails "Kernel#String raises a TypeError if respond_to? returns false for #to_s"
fails "Kernel#String raises a TypeError if #to_s is not defined, even though #respond_to?(:to_s) returns true"
fails "Kernel#String calls #to_s if #respond_to?(:to_s) returns true"
end
1 change: 1 addition & 0 deletions spec/filters/unsupported/private_methods.rb
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@
fails "Kernel#Float is a private method"
fails "Kernel#format is a private method"
fails "Kernel#sprintf is a private method"
fails "Kernel#String is a private method"
fails "Kernel#warn is a private method"

fails "Module#instance_methods makes a private Object instance method public in Kernel"
1 change: 1 addition & 0 deletions spec/rubyspecs
Original file line number Diff line number Diff line change
@@ -59,6 +59,7 @@ corelib/core/kernel/hash_spec
corelib/core/kernel/Integer_spec
corelib/core/kernel/Float_spec
corelib/core/kernel/sprintf_spec
corelib/core/kernel/String_spec
corelib/core/kernel/tap_spec
corelib/core/kernel/to_s_spec
corelib/core/kernel/warn_spec