Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Temporarily revert because I boned original tag (will reapply after l…

…aying new accurate tag)
  • Loading branch information...
commit 0f73d7bc83211cf945e9dfce8a7bbe0fbcc36816 1 parent d24646d
@enebo enebo authored
View
10 spec/regression/JRUBY-6892_drop_on_enumerator_oddity_spec.rb
@@ -1,10 +0,0 @@
-require 'rspec'
-
-describe "Enumerable#drop" do
- context "when called on an Enumerator" do
- let(:enumerator) { (1..10).to_a.each_slice(3)}
- it "should behave as if it is called on an Enumerable" do
- enumerator.drop(2).should == [[7,8,9],[10]]
- end
- end
-end
View
5 src/org/jruby/RubyEnumerable.java
@@ -280,10 +280,7 @@ public IRubyObject call(ThreadContext ctx, IRubyObject[] largs, Block blk) {
IRubyObject larg = checkArgs(runtime, largs);
synchronized (result) {
if (i == 0) {
- // While iterating over an RubyEnumerator, "arg"
- // gets overwritten by the new value, leading to JRUBY-6892.
- // So call .dup() whenever appropriate.
- result.append(larg.isImmediate() ? larg : larg.dup());
+ result.append(larg);
} else {
--i;
}
Please sign in to comment.
Something went wrong with that request. Please try again.