Skip to content

Commit

Permalink
Clean up some redundant aray filters
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Nov 27, 2013
1 parent 96db8c5 commit 423241a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 2 additions & 0 deletions opal/corelib/array.rb
Expand Up @@ -1089,6 +1089,8 @@ def pop(count = undefined)
return length === 0 ? nil : self.pop();
}
count = #{Opal.coerce_to `count`, Integer, :to_int};
if (count < 0) {
#{ raise ArgumentError, "negative count given" };
}
Expand Down
13 changes: 0 additions & 13 deletions spec/opal/filters/bugs/array.rb
Expand Up @@ -18,11 +18,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#concat tries to convert the passed argument to an Array using #to_ary"
fails "Array#concat is not infected by the other"

fails "Array#delete_if returns an Enumerator if no block given, and the enumerator can modify the original array"

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 #=="

Expand Down Expand Up @@ -101,21 +96,13 @@
fails "Array.new with (size, object=nil) calls #to_int to convert the size argument to an Integer when object is not given"
fails "Array.new with (size, object=nil) raises a TypeError if the size argument is not an Integer type"

fails "Array#+ tries to convert the passed argument to an Array using #to_ary"

fails "Array#pop passed a number n as an argument raises an ArgumentError if more arguments are passed"
fails "Array#pop passed a number n as an argument raises a TypeError when the passed n can be coerced to Integer"
fails "Array#pop passed a number n as an argument tries to convert n to an Integer using #to_int"

fails "Array#rassoc does not check the last element in each contained but speficically the second"
fails "Array#rassoc calls elem == obj on the second element of each contained array"

fails "Array#replace tries to convert the passed argument to an Array using #to_ary"

fails "Array#rindex rechecks the array size during iteration"

fails "Array#select returns a new array of elements for which block is true"

fails "Array#shift passed a number n as an argument raises an ArgumentError if more arguments are passed"
fails "Array#shift passed a number n as an argument raises a TypeError when the passed n can be coerced to Integer"
fails "Array#shift passed a number n as an argument tries to convert n to an Integer using #to_int"
Expand Down
2 changes: 2 additions & 0 deletions spec/opal/filters/unsupported/tainted.rb
Expand Up @@ -10,6 +10,8 @@

fails "Array#+ does not get infected even if an original array is tainted"

fails "Array#concat is not infected by the other"

fails "Array#clear keeps tainted status"

fails "Array#clone copies taint status from the original"
Expand Down

0 comments on commit 423241a

Please sign in to comment.