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: 599c80cf867d
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0ff459ae3efd
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on May 1, 2015

  1. Copy the full SHA
    b1a42c2 View commit details
  2. Merge pull request #822 from vais/regexp-case-compare

    Make Regexp#=== set global match data vars
    elia committed May 1, 2015
    Copy the full SHA
    0ff459a View commit details
Showing with 3 additions and 13 deletions.
  1. +3 −13 opal/corelib/regexp.rb
16 changes: 3 additions & 13 deletions opal/corelib/regexp.rb
Original file line number Diff line number Diff line change
@@ -35,22 +35,12 @@ def ==(other)
`other.constructor == RegExp && self.toString() === other.toString()`
end

def ===(str)
%x{
if (!str.$$is_string && #{str.respond_to?(:to_str)}) {
#{str = str.to_str};
}
if (!str.$$is_string) {
return false;
}
return self.test(str);
}
def ===(string)
`#{match(string)} !== nil`
end

def =~(string)
return match(string) && $~.begin(0)
match(string) && $~.begin(0)
end

alias eql? ==