| Age | Commit message (Collapse) | Author |
|
* This reverts commit 065c48cdf11a1c4cece84db44ed8624d294f8fd5.
* This functionality is very valuable and has already taken 14 years
to agree on the API.
* Let's just document it's byte columns (in the next commit).
* See https://bugs.ruby-lang.org/issues/21783#note-9
|
|
|
|
and columns"
This reverts commit 073c4e1cc712064e626914fa4a5a8061f903a637.
https://bugs.ruby-lang.org/issues/6012#note-31
> we will cancel this feature in 4.0 because of design ambiguities
> such as whether to return column positions in bytes or characters as
> in [#21783].
[#21783]: https://bugs.ruby-lang.org/issues/21783
|
|
is passed (#15530)
|
|
[Bug #21049]
|
|
This changeset introduces:
* `Binding#implicit_parameters`
* `Binding#implicit_parameter_get`
* `Binding#implicit_parameter_defined?`
[Bug #21049]
|
|
[Bug #21776]
|
|
[Bug #21776]
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13395
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12746
|
|
[Bug #20955]
|
|
Have this for lead parameters as well as parameters after rest ("post").
[Bug #20974]
Notes:
Merged: https://github.com/ruby/ruby/pull/12547
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12539
|
|
[Bug #20950]
ifunc proc has the ep allocated in the cfunc_proc_t which is the data of
the TypedData object. If an ifunc proc is duplicated, the ep points to
the ep of the source object. If the source object is freed, then the ep
of the duplicated object now points to a freed memory region. If we try
to use the ep we could crash.
For example, the following script crashes:
p = { a: 1 }.to_proc
100.times do
p = p.dup
GC.start
p.call
rescue ArgumentError
end
This commit changes ifunc proc to also duplicate the ep when it is duplicated.
Notes:
Merged: https://github.com/ruby/ruby/pull/12319
|
|
not supported
Notes:
Merged: https://github.com/ruby/ruby/pull/11980
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11966
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11966
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11966
|
|
The hash value of a Proc must remain constant after a compaction, otherwise
it may not work as the key in a hash table.
Notes:
Merged: https://github.com/ruby/ruby/pull/11966
|
|
The following code crashes with assertions enabled because envval could
be Qundef:
{}.to_proc.dup
Notes:
Merged: https://github.com/ruby/ruby/pull/11970
|
|
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11611
|
|
Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
|
|
|
|
Previously, Kernel#lambda returned a non-lambda proc when given a
non-literal block and issued a warning under the `:deprecated` category.
With this change, Kernel#lambda will always return a lambda proc, if it
returns without raising.
Due to interactions with block passing optimizations, we previously had
two separate code paths for detecting whether Kernel#lambda got a
literal block. This change allows us to remove one path, the hack done
with rb_control_frame_t::block_code introduced in 85a337f for supporting
situations where Kernel#lambda returned a non-lambda proc.
[Feature #19777]
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/8405
|
|
Autosplat should not occur if there are two arguments but second
argument is an array containing a ruby2_keywords splat. Only
autosplat if a single argument to be yielded to the block, and there
is no splatted flagged keyword hash passed.
Fixes [Bug #19759]
Notes:
Merged: https://github.com/ruby/ruby/pull/8039
Merged-By: jeremyevans <code@jeremyevans.net>
|
|
Check whether the current or previous frame is a Ruby frame in
call_trace_func and rb_tracearg_binding before attempting to
create a binding for the frame.
Fixes [Bug #18487]
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/5767
Merged-By: jeremyevans <code@jeremyevans.net>
|
|
This reverts commit 343ea9967e4a6b279eed6bd8e81ad0bdc747f254.
This causes an assertion failure with -DRUBY_DEBUG=1 -DRGENGC_CHECK_MODE=2
|
|
If the block only accepts a single positional argument plus keywords,
then do not autosplat. Still autosplat if the block accepts more
than one positional argument in addition to keywords.
Autosplatting a single positional argument plus keywords made sense
in Ruby 2, since a final positional hash could be used as keywords,
but it does not make sense in Ruby 3.
Fixes [Bug #18633]
Notes:
Merged: https://github.com/ruby/ruby/pull/5665
Merged-By: jeremyevans <code@jeremyevans.net>
|
|
Check whether the current or previous frame is a Ruby frame in
call_trace_func before attempting to create a binding for the frame.
Fixes [Bug #18487]
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/5567
|
|
lambda
This makes it easier to use Proc#parameters to build wrappers.
Implements [Feature #15357]
Notes:
Merged: https://github.com/ruby/ruby/pull/5677
|
|
T#dup (T < Proc) returns Proc object (not T) from Ruby 1.9.
[Bug #17545]
Notes:
Merged: https://github.com/ruby/ruby/pull/4197
|
|
This allows for the following syntax:
```ruby
def foo(*)
bar(*)
end
def baz(**)
quux(**)
end
```
This is a natural addition after the introduction of anonymous
block forwarding. Anonymous rest and keyword rest arguments were
already supported in method parameters, this just allows them to
be used as arguments to other methods. The same advantages of
anonymous block forwarding apply to rest and keyword rest argument
forwarding.
This has some minor changes to #parameters output. Now, instead
of `[:rest], [:keyrest]`, you get `[:rest, :*], [:keyrest, :**]`.
These were already used for `...` forwarding, so I think it makes
it more consistent to include them in other cases. If we want to
use `[:rest], [:keyrest]` in both cases, that is also possible.
I don't think the previous behavior of `[:rest], [:keyrest]` in
the non-... case and `[:rest, :*], [:keyrest, :**]` in the ...
case makes sense, but if we did want that behavior, we'll have to
make more substantial changes, such as using a different ID in the
... forwarding case.
Implements [Feature #18351]
Notes:
Merged: https://github.com/ruby/ruby/pull/5148
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5053
|
|
The ArgumentError should raise in `isolate`.
Notes:
Merged: https://github.com/ruby/ruby/pull/5053
|
|
The shift was causing far fewer unique values of hash than expected.
Fix pointed out by xtkoba (Tee KOBAYASHI)
Fixes [Bug #17951]
Notes:
Merged: https://github.com/ruby/ruby/pull/4574
|
|
Instead of suppressing all warnings wholly in each test scripts by
setting `$VERBOSE` to `nil` in `setup` methods.
Notes:
Merged: https://github.com/ruby/ruby/pull/3925
Merged-By: nobu <nobu@ruby-lang.org>
|
|
There are warning condition bugs and test bugs.
b53ccb9c69abd24e3bdad66cbe4c7e7480eaef16
|
|
lambda(&b) where b is given block of method (like: def foo(&b))
should warn correctly.
[Feature #17361]
Also labmda(&labmda_block) or lambda(&:to_s) (Symbol#to_proc)
should not warn (but I'm not sure who cares about it).
|
|
Isolated Proc prohibit to access outer local variables, but it was
violated by binding and so on, so they should be error.
Notes:
Merged: https://github.com/ruby/ruby/pull/3721
|
|
Previously, these were not implemented, and Object#== and #eql?
were used. This tries to check the proc internals to make sure
that procs created from separate blocks are treated as not equal,
but procs created from the same block are treated as equal, even
when the lazy proc allocation optimization is used.
Implements [Feature #14267]
Notes:
Merged: https://github.com/ruby/ruby/pull/3174
|
|
The warning for these was added in 2.7.
Notes:
Merged: https://github.com/ruby/ruby/pull/3208
|
|
When providing a single array to a block that takes a splat, pass the
array as one argument of the splat instead of as the splat itself,
even if the block also accepts keyword arguments. Previously, this
behavior was only used for blocks that did not accept keywords.
Implements [Feature#16166]
Notes:
Merged: https://github.com/ruby/ruby/pull/2502
|
|
Mysterious error:
`remove_method(:foo) if method_defined?(:foo)` raise an exception
`method `foo' not defined in #<Class:#<TestProc:0x000055d12ff154e0>>`
This patch rename the method name foo to foo_arity to solve it.
|
|
With the removal of the splatted argument when using an empty
keyword splat, the autosplat code considered an empty keyword
splat the same as no argument at all. However, that results
in autosplat behavior changing dependent on the content of
the splatted hash, which is not what anyone would expect or
want. This change always skips an autosplat if keywords were
provided.
Fixes [Bug #16560]
Notes:
Merged: https://github.com/ruby/ruby/pull/2861
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/2794
|
|
This removes the warnings added in 2.7, and changes the behavior
so that a final positional hash is not treated as keywords or
vice-versa.
To handle the arg_setup_block splat case correctly with keyword
arguments, we need to check if we are taking a keyword hash.
That case didn't have a test, but it affects real-world code,
so add a test for it.
This removes rb_empty_keyword_given_p() and related code, as
that is not needed in Ruby 3. The empty keyword case is the
same as the no keyword case in Ruby 3.
This changes rb_scan_args to implement keyword argument
separation for C functions when the : character is used.
For backwards compatibility, it returns a duped hash.
This is a bad idea for performance, but not duping the hash
breaks at least Enumerator::ArithmeticSequence#inspect.
Instead of having RB_PASS_CALLED_KEYWORDS be a number,
simplify the code by just making it be rb_keyword_given_p().
Notes:
Merged: https://github.com/ruby/ruby/pull/2794
|
|
* Deciding lambdaness of (f << g) using g
* Use version guards for spec changes
Notes:
Merged-By: XrXr
|