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

Commits on Mar 7, 2015

  1. Pass "Array#delete returns the last element in the array for which ob…

    …ject is equal under #=="
    vais committed Mar 7, 2015
    Copy the full SHA
    cb0725e View commit details
  2. Copy the full SHA
    5bc61f6 View commit details
  3. Merge pull request #734 from vais/array

    Array#delete implementation fully compliant with rubyspec
    elia committed Mar 7, 2015
    Copy the full SHA
    d365873 View commit details
Showing with 7 additions and 4 deletions.
  1. +7 −1 opal/corelib/array.rb
  2. +0 −3 spec/filters/bugs/array.rb
8 changes: 7 additions & 1 deletion opal/corelib/array.rb
Original file line number Diff line number Diff line change
@@ -634,7 +634,13 @@ def delete(object)
}
}
return self.length === original ? nil : object;
if (self.length === original) {
if (#{block_given?}) {
return #{yield};
}
return nil;
}
return object;
}
end

3 changes: 0 additions & 3 deletions spec/filters/bugs/array.rb
Original file line number Diff line number Diff line change
@@ -17,9 +17,6 @@
fails "Array#<=> tries to convert the passed argument to an Array using #to_ary"
fails "Array#<=> returns nil when the argument is not array-like"

fails "Array#delete may be given a block that is executed if no element matches object"
fails "Array#delete returns the last element in the array for which object is equal under #=="

fails "Array.[] can unpack 2 or more nested referenced array"

fails "Array#[]= sets elements in the range arguments when passed ranges"