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

Commits on Aug 28, 2015

  1. Copy the full SHA
    5b19e6b View commit details
  2. Merge pull request #1083 from iliabylich/implement-missing-methods-on…

    …-nil
    
    Implemented nil#to_c, nil#to_r, nil#rationalize.
    meh committed Aug 28, 2015
    Copy the full SHA
    6da7f6a View commit details
Showing with 13 additions and 7 deletions.
  1. +13 −0 opal/corelib/nil.rb
  2. +0 −7 spec/filters/bugs/nil.rb
13 changes: 13 additions & 0 deletions opal/corelib/nil.rb
Original file line number Diff line number Diff line change
@@ -52,6 +52,19 @@ def to_i
def to_s
''
end

def to_c
Complex.new(0, 0)
end

def rationalize(*args)
raise ArgumentError if args.length > 1
Rational(0, 1)
end

def to_r
Rational(0, 1)
end
end

NIL = nil
7 changes: 0 additions & 7 deletions spec/filters/bugs/nil.rb

This file was deleted.