Issue #14846 has been updated by Eregon (Benoit Daloze).


I think those changes related to uplevel: should also be backported, unless they are already part of 2.5 of course:

r63062: error.c: prepend "warning: " always (fixes the first problem shown above)
r61527: error.c (rb_warn_m): limit backtrace depth to reduce objects to be created but not used.
r61525: error.c (rb_warn_m): negative uplevel is not allowed. [ruby-core:84568] [Bug #14262]. (I think that fixes the second problem shown above).


----------------------------------------
Bug #14846: Backport fixes for Kernel#warn(uplevel:)
https://bugs.ruby-lang.org/issues/14846#change-72646

* Author: Eregon (Benoit Daloze)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
* Backport: 2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED
----------------------------------------
~~~ ruby
-> { warn("foo", 100) }.should output(nil, "warning: foo\n")
~~~
It is missing the "warning: " prefix in 2.5.1.

~~~ ruby
-> { warn "", uplevel: -1 }.should raise_error(ArgumentError)
~~~
It doesn't raise in 2.5.1 even though `warn "", uplevel: -2` does.

Both were fixed on trunk.
I believe it should be fixed in 2.5 as that is buggy behavior.

Then https://github.com/ruby/spec/commit/dea70b1c50f2cba7624b764fea639edfcff11ced can be reverted.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>