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: f87d14a738da
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5fee18331fc0
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Apr 27, 2015

  1. Copy the full SHA
    b18228c View commit details
  2. Merge pull request #814 from vais/kernel-hash

    Kernel#Hash fully compliant with rubyspec
    elia committed Apr 27, 2015

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    5fee183 View commit details
Showing with 8 additions and 0 deletions.
  1. +6 −0 opal/corelib/kernel.rb
  2. +1 −0 spec/filters/unsupported/private_methods.rb
  3. +1 −0 spec/rubyspecs
6 changes: 6 additions & 0 deletions opal/corelib/kernel.rb
Original file line number Diff line number Diff line change
@@ -888,6 +888,12 @@ def Float(value)
}
end

def Hash(arg)
return {} if arg.nil? || arg == []
return arg if Hash === arg
return Opal.coerce_to!(arg, Hash, :to_hash)
end

def is_a?(klass)
`Opal.is_a(self, klass)`
end
1 change: 1 addition & 0 deletions spec/filters/unsupported/private_methods.rb
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@
fails "Math#atanh is a private instance method"

fails "Kernel has private instance method Array()"
fails "Kernel has private instance method Hash()"
fails "Kernel#Integer is a private method"
fails "Kernel#Float is a private method"
fails "Kernel#format is a private method"
1 change: 1 addition & 0 deletions spec/rubyspecs
Original file line number Diff line number Diff line change
@@ -54,6 +54,7 @@ corelib/core/kernel/eql_spec
corelib/core/kernel/equal_spec
corelib/core/kernel/equal_value_spec
corelib/core/kernel/format_spec
corelib/core/kernel/hash_spec
corelib/core/kernel/Integer_spec
corelib/core/kernel/Float_spec
corelib/core/kernel/sprintf_spec