-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Description
Here's the living checklist of changes needed to support Ruby 2.3.
These changes will go on the 2.3 branch at https://github.com/jruby/jruby/tree/ruby-2.3 and then we will merge to master when we're ready to release 2.3 support in JRuby 9.1.0.0.
Pull requests should be made against the ruby-2.3 branch please!
This list is currently based on https://github.com/ruby/ruby/blob/v2_3_0_preview2/NEWS.
Language changes
- frozen-string-literal pragma:
- new pragma, frozen-string-literal has been experimentally introduced. (https://bugs.ruby-lang.org/issues/8976)
- besides, --enable/--disable=frozen-string-literal options also have been introduced. (https://bugs.ruby-lang.org/issues/8976)
- command line options --debug or --debug=frozen-string-literal enable additional debugging mode which shows created location with at frozen object error (RuntimeError). (https://bugs.ruby-lang.org/issues/11725)
- safe navigation operator:
- new method call syntax,
object&.foo', method #foo is called onobject' if it is not nil.
this is similar to `try!' in Active Support, except:- method name is syntactically required
obj.try! {} # valid
obj&. {} # syntax error - arguments are evaluated only if a call is made:
obj.try!(:foo, bar()) # bar() is always evaluated
obj&.foo(bar()) # bar() is conditionally evaluated - attribute assignment is valid
obj&.attr += 1 - (https://bugs.ruby-lang.org/issues/11537)
- method name is syntactically required
- new method call syntax,
- indented here document:
- new string literal, here document starts with
<<~. refer doc/syntax/literals.rdoc for more details. (https://bugs.ruby-lang.org/issues/9098)
- new string literal, here document starts with
- Additional parser changes
-
class Foo endis no longer a syntax error (see tagged specs in 0304cc7).
-
- Changes in how super works for methods copied from parent to child. See https://bugs.ruby-lang.org/issues/3351 and RSpec mocks isn't properly rolling back stubbed any_instance methods with ruby 2.3.0-preview2 rspec/rspec-mocks#1042
Core classes updates (outstanding ones only)
- ARGF
- ARGF.read_nonblock supports `exception: false' like IO#read_nonblock.
(https://bugs.ruby-lang.org/issues/11358)
- ARGF.read_nonblock supports `exception: false' like IO#read_nonblock.
- Array
- Array#bsearch_index (https://bugs.ruby-lang.org/issues/10730)
- Array#dig (https://bugs.ruby-lang.org/issues/11643) needs rubyspec update (see Ruby 2.3's #dig #3458)
- Enumerable
- Enumerable#grep_v is added as inverse version of Enumerable#grep.
(https://bugs.ruby-lang.org/issues/11049) - Enumerable#chunk_while (https://bugs.ruby-lang.org/issues/10769)
- Enumerable#grep_v is added as inverse version of Enumerable#grep.
- File
- File.mkfifo (https://bugs.ruby-lang.org/issues/11536) (4a79bca)
- Add File::TMPFILE corresponding to O_TMPFILE (876445b)
- Hash
- Hash#fetch_values (https://bugs.ruby-lang.org/issues/10017)
- Hash#dig (https://bugs.ruby-lang.org/issues/11643) needs rubyspec update (see Ruby 2.3's #dig #3458)
- Hash#<=, Hash#<, Hash#>=, Hash#> (https://bugs.ruby-lang.org/issues/10984)
- Hash#to_proc (https://bugs.ruby-lang.org/issues/11653)
- IO
- new mode flag File::SHARE_DELETE is available.
this flag means to permit deleting opened file on Windows, but currently
this affect only files opened as binary. (https://bugs.ruby-lang.org/issues/11218) - new option parameter `flags' is added.
this parameter is bitwise-ORed to oflags generated by normal mode argument.
(https://bugs.ruby-lang.org/issues/11253)
- new mode flag File::SHARE_DELETE is available.
- Kernel
- Kernel#loop, when stopped by a StopIteration exception, returns
what the enumerator has returned instead of nil. (https://bugs.ruby-lang.org/issues/11498)
- Kernel#loop, when stopped by a StopIteration exception, returns
- Module
- Module#deprecate_constant (https://bugs.ruby-lang.org/issues/11398)
- NameError
- NameError#receiver is added to take the receiver object. (https://bugs.ruby-lang.org/issues/10881) (Added in f7088b9)
- Numeric
- Numeric#positive? and Numeric#negative? are added, which return
true when the receiver is positive and negative respectively.
(https://bugs.ruby-lang.org/issues/11151)
- Numeric#positive? and Numeric#negative? are added, which return
- Proc
- Proc#call (and also #[], #===, #yield) are optimized.
Backtrace doesn't show each methods (show block lines directly).- TracePoint also ignore these calls. (https://bugs.ruby-lang.org/issues/11569)
- Testing
- Proc#call (and also #[], #===, #yield) are optimized.
- Queue (Thread::Queue)
- Queue#close is added to notice a termination. (https://bugs.ruby-lang.org/issues/10600) (Added in 2531143)
- Benchmark modified Queue and SizedQueue implementations from 2531143. (New impls contributed in [Ruby 2.3] Concurrency improvements to Queue/SizedQueue #3553 based on blocking queues we used to use)
- Reconcile tests that do not seem correct (https://bugs.ruby-lang.org/issues/11822)
- Regexp/String: Updated Unicode version from 7.0.0 to 8.0.0
- Ensure manual change in jruby/jcodings@4bcfdc3#diff-63b6d8b6c8616d7df068493913a90413R136 is preserved during update
- String
- String#+@ and String#-@ are added to get mutable/frozen strings. (https://bugs.ruby-lang.org/issues/11782)
- String.new now accepts new option parameter `encoding'. (https://bugs.ruby-lang.org/issues/11785)
- Struct
- Struct#dig (https://bugs.ruby-lang.org/issues/11688)
- Thread
- Thread#name, Thread#name= are added to handle thread names (https://bugs.ruby-lang.org/issues/11251)
Core classes compatibility issues (excluding feature bug fixes)
- Array
- Array#select!, Array#keep_if, Array#reject!, and Array#delete_if
no longer changes the receiver array instantly every time the
block is called. (https://bugs.ruby-lang.org/issues/10714) - Array#flatten and Array#flatten! no longer try to call #to_ary
method on elements beyond the given level. (https://bugs.ruby-lang.org/issues/10748) - Array#inspect doesn't raise error even if its content returns
a string which is not compatible with Encoding.default_external
as inspected result. (https://bugs.ruby-lang.org/issues/11801) 7f47946
- Array#select!, Array#keep_if, Array#reject!, and Array#delete_if
- Enumerable
- Enumerable#chunk and Enumerable#slice_before no longer takes the
initial_state argument. (https://bugs.ruby-lang.org/issues/10958)
Use a local variable instead to maintain a state. remove "initial_state" argument of Enumerable#{slice_before,chunk} #3490
- Enumerable#chunk and Enumerable#slice_before no longer takes the
- File::Stat
- On Windows File::Stat#ino always returned 0, but now returns
BY_HANDLE_FILE_INFORMATION.nFileIndexHigh/Low.
- On Windows File::Stat#ino always returned 0, but now returns
- Hash
- Hash#inspect doesn't raise error even if its content returns
a string which is not compatible with Encoding.default_external
as inspected result. (https://bugs.ruby-lang.org/issues/11801) 7f47946
- Hash#inspect doesn't raise error even if its content returns
- IO
- IO#close doesn't raise when the IO object is closed. (https://bugs.ruby-lang.org/issues/10718)
- IO#each_codepoint raises an exception at incomplete character
before EOF when conversion takes place. (https://bugs.ruby-lang.org/issues/11444) (866c248)
- Module
- Module#define_method and Object.define_singleton_method now
require method body, Proc, Method, or a block, and raise
ArgumentError if no block is given directly. (https://bugs.ruby-lang.org/issues/11283)
- Module#define_method and Object.define_singleton_method now
- StringIO
- StringIO#set_encoding sets an internal encoding - String only affected when writeable (https://bugs.ruby-lang.org/issues/11827)
- pack/unpack (Array/String)
- j and J directives for pointer width integer type. (https://bugs.ruby-lang.org/issues/11215)
Stdlib updates (outstanding ones only)
Only items relevant to JRuby
- Update .rb parts of stdlib to 2.3 (delay until 2.3.0 final, probably) 66570f0
- Bundle did_you_mean gem Bundle did_you_mean gem #3480
- Socket
- Socket#connect_nonblock, Socket#accept_nonblock,
TCPServer#accept_nonblock, UNIXServer#accept_nonblock,
BasicSocket#recv_nonblock, BasicSocket#recvmsg_nonblock,
BasicSocket#sendmsg_nonblock all supportexception: falseto return
:wait_readable or :wait_writable symbols instead of raising
IO::WaitReadable or IO::WaitWritable exceptions (b27a2b0) - BasicSocket#recv and BasicSocket#recv_nonblock allow an output
String buffer argument like IO#read and IO#read_nonblock to reduce
GC overhead
- Socket#connect_nonblock, Socket#accept_nonblock,
- OpenSSL
- OpenSSL::SSL::SSLSocket#accept_nonblock and
OpenSSL::SSL::SSLSocket#connect_nonblock supportsexception: false. - update OpenSSL's .rb parts to match changes in 2.3
- test & update jruby-openssl to be >= 0.9.13 (to incorporate above updates)
- OpenSSL::SSL::SSLSocket#accept_nonblock and
- Pathname
- Pathname#descend and Pathname#ascend supported blockless form.
(https://bugs.ruby-lang.org/issues/11052)
- Pathname#descend and Pathname#ascend supported blockless form.
- io/wait
- timeout
- Object#timeout is now warned as deprecated when called. (a042a39)
Stdlib compatibility issues (excluding feature bug fixes)
Only items relevant to JRuby
- ext/coverage/coverage.c
- Coverage.peek_result: new method to allow coverage to be captured without
stopping the coverage tool. implement Coverage.peek_result #3481
- Coverage.peek_result: new method to allow coverage to be captured without
Reactions are currently unavailable