| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This reverts commit 5294ded681992ced2ecbd31c814b63265d2f591e.
|
|
|
|
| |
https://github.com/ruby/io-console/commit/a3ad851b6c
|
|
|
|
| |
https://github.com/ruby/io-console/commit/ab7653c543
|
|
|
|
|
|
| |
It results in a mysterious failure.
https://github.com/ruby/io-console/commit/e3543c3da4
|
| |
|
| |
|
|
|
|
| |
https://github.com/ruby/io-console/commit/9377e37295
|
|
|
|
|
| |
Kernel#send takes a different optimized code path that was already
handled.
|
|
|
|
| |
instead of deprecated BigDecimal.new.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is how Kernel#{Array,String,Float,Integer,Hash,Rational} work.
BigDecimal and Complex instances are always frozen, so this should
not cause backwards compatibility issues for those. Pathname
instances are not frozen, so potentially this could cause backwards
compatibility issues by not returning a new object.
Based on a patch from Joshua Ballanco, some minor changes by me.
Fixes [Bug #7522]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Module#class_variables should reflect class variable lookup. For
singleton classes of classes/modules, this means the lookup should
be:
* Singleton Class
* Class
* All Ancestors of Class
Note that this doesn't include modules included in the singleton
class, because class variable lookup doesn't include those.
Singleton classes of other objects do not have this behavior and
always just search all ancestors of the singleton class, so do not
change the behavior for them.
Fixes [Bug #8297]
|
|
|
|
| |
to suppress variable unused warning
|
|
|
|
|
|
|
|
|
| |
When Object#to_enum is passed a block, the block is called to get
a size with the arguments given to to_enum. This calls the block
with the same keyword flag as to_enum is called with.
This requires adding rb_check_funcall_kw and
rb_check_funcall_default_kw to handle keyword flags.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If defined in Ruby, dig would be defined as def dig(arg, *rest) end,
it would not use keywords. If the last dig argument was an empty
hash, it could be treated as keyword arguments by the next dig
method. Allow dig to pass along the empty keyword flag if called
with an empty keyword, to suppress the previous behavior and force
treating the hash as a positional argument and not keywords.
Also handle the case where dig calls method_missing, passing the
empty keyword flag to that as well.
This requires adding rb_check_funcall_with_hook_kw functions, so
that dig can specify how arguments are treated. It also adds
kw_splat arguments to a couple static functions.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
[Feature #11297] [Feature #16123]
|
|
|
|
|
|
|
|
|
|
| |
This makes it consistent with calling private attribute assignment
methods, which currently is allowed (e.g. `self.value =`).
Calling a private method in this way can be useful when trying to
assign the return value to a local variable with the same name.
[Feature #11297] [Feature #16123]
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Replace [arg=1, args] with [arg, args] so we can actually test
the value correctly.
Add some missing tests for **h3 when method accepts (**args).
Add tests for passing positional hashes to (**args) methods and
check for the expected warnings/errors.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make sure that vm_yield_with_cfunc can correctly set the empty keyword
flag by passing 2 as the kw_splat value when calling it in
vm_invoke_ifunc_block. Make sure calling.kw_splat is set to 1 and not
128 in vm_sendish, so we can safely check for different kw_splat values.
vm_args.c needs to call add_empty_keyword, and to make JIT happy, the
function needs to be exported. Rename the function to
rb_adjust_argv_kw_splat to more accurately reflect what it does, and
mark it as MJIT exported.
|
|
|
|
|
|
|
|
| |
This makes method_missing take a flag for whether keyword arguments
were passed.
Adds tests both for rb_call_super_kw usage as well as general usage
of super calling method_missing in Ruby methods.
|
| |
|
|
|
|
|
|
|
|
|
| |
This sets the correct VM frame flags when using Method#call to
call funcs, and handles empty keyword hashes for cfuncs,
attr_reader, and attr_writer. It also fixes calls to send through
Method#call. It adds tests for all of those, as well as tests for
using Method#call to call define_method, lambda, and sym_procs
(which didn't require code changes).
|
| |
|
|
|
|
| |
Co-authored-by: Victor Shepelev <zverok.offline@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Previously, the warning functions skipped warning in these cases.
This removes the skipping, and uses a less descriptive warning
instead.
This affected both last argument to keyword warnings and keyword
split warnings.
|
|
|
|
| |
Solaris 10 returns addrinfo.ai_protocol as 0, not 6.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Addrinfo.getaddrinfo and .foreach now accepts :timeout in seconds as
a keyword argument. If getaddrinfo_a(3) is available, the timeout will be
applied for name resolution. Otherwise, it will be ignored.
Socket.tcp accepts :resolv_timeout to use this feature.
This commit is retry of 6382f5cc91ac9e36776bc854632d9a1237250da7.
Test was failed on Solaris machines which don't have "http" in
/etc/services. In this commit, use "ssh" instead.
|
|
|
|
|
| |
This reverts commit 6382f5cc91ac9e36776bc854632d9a1237250da7.
test failed on Solaris.
|
|
|
|
|
|
| |
Calling some syscall functions such as Dir.chroot causes SIGSYS instead
of EPERM on Android.
This change skips all tests that stops the test-suite run.
|
| |
|
|
|
|
| |
change service name to fix failed test on Solaris
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes an invalid keyword argument separation warning for
code such as:
```ruby
def foo(arg)
arg
end
kw = {}
foo(*[1], **kw)
```
This warning was caused because the remove_empty_keyword_hash
was set based on a comparison with two variables, and in this
case, one of the variables was updated after the check and we
need to use the updated variable.
Simplify things by just inlining the comparison.
|
|
|
|
|
|
|
|
| |
Addrinfo.getaddrinfo and .foreach now accepts :timeout in seconds as
a keyword argument. If getaddrinfo_a(3) is available, the timeout will be
applied for name resolution. Otherwise, it will be ignored.
Socket.tcp accepts :resolv_timeout to use this feature.
|
|
|
|
|
| |
No code changes are necessary, but we didn't have as extensive
tests for these calls previously.
|
|
|
|
|
|
|
| |
`[{}, {}, {}, ..., {}, *{}]` is wrongly created.
A big array literal is created and concatenated for every 256 elements.
The newarraykwsplat must be emitted only at the last chunk.
|
|
|
|
|
|
|
|
|
|
| |
and NODE_ZARRAY to NODE_ZLIST.
NODE_ARRAY is used not only by an Array literal, but also the contents
of Hash literals, method call arguments, dynamic string literals, etc.
In addition, the structure of NODE_ARRAY is a linked list, not an array.
This is very confusing, so I believe `NODE_LIST` is a better name.
|
|
|
|
| |
This were previously hidden because calls from C were not warned.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Method#call, UnboundMethod#bind_call
Also add keyword argument separation warnings for Class#new and Method#call.
To allow for keyword argument to required positional hash converstion in
cfuncs, add a vm frame flag indicating the cfunc was called with an empty
keyword hash (which was removed before calling the cfunc). The cfunc can
check this frame flag and add back an empty hash if it is passing its
arguments to another Ruby method. Add rb_empty_keyword_given_p function
for checking if called with an empty keyword hash, and
rb_add_empty_keyword for adding back an empty hash to argv.
All of this empty keyword argument support is only for 2.7. It will be
removed in 3.0 as Ruby 3 will not convert empty keyword arguments to
required positional hash arguments. Comment all of the relevent code
to make it obvious this is expected to be removed.
Add rb_funcallv_kw as an public C-API function, just like rb_funcallv
but with a keyword flag. This is used by rb_obj_call_init (internals
of Class#new). This also required expected call_type enum with
CALL_FCALL_KW, similar to the recent addition of CALL_PUBLIC_KW.
Add rb_vm_call_kw as a internal function, used by call_method_data
(internals of Method#call and UnboundMethod#bind_call). Add tests
for UnboundMethod#bind_call keyword handling.
|
| |
|
|
|
|
|
|
|
|
| |
method_missing
This is the same as the bmethod, sym proc, and send cases,
where we don't remove the keyword splat, so later code can
move it to a required positional parameter and warn.
|
|
|
|
|
|
|
|
| |
procs
This is the same as the bmethod and send cases, where we don't
remove the keyword splat, so later code can move it to to a
a required positional parameter and warn.
|