[#71439] [Ruby trunk - Feature #11339] [PATCH] io.c: avoid kwarg parsing in C API — matz@...
Issue #11339 has been updated by Yukihiro Matsumoto.
7 messages
2015/11/11
[#71473] Re: [Ruby trunk - Feature #11339] [PATCH] io.c: avoid kwarg parsing in C API
— Eric Wong <normalperson@...>
2015/11/13
Entire series for sockets
[#71450] Ruby 2.3.0-preview1 Released — "NARUSE, Yui" <naruse@...>
Hi,
5 messages
2015/11/11
[#71617] [Ruby trunk - Feature #11664] [PATCH] introduce rb_autoload_value to replace rb_autoload — nobu@...
Issue #11664 has been updated by Nobuyoshi Nakada.
3 messages
2015/11/20
[#71721] [Ruby trunk - Feature #11741] Migrate Ruby to Git from Subversion — me@...
Issue #11741 has been updated by Jon Moss.
4 messages
2015/11/28
[ruby-core:71640] [Ruby trunk - Bug #11718] Constant access on `nil`
From:
elia@...
Date:
2015-11-23 14:25:42 UTC
List:
ruby-core #71640
Issue #11718 has been updated by Elia Schito.
looks like it's somehow intended behavior
https://github.com/ruby/ruby/blob/trunk/insns.def#L179-L190
/**
@c variable
@e
Get constant variable id. If klass is Qnil, constants
are searched in the current scope. If klass is Qfalse, constants
are searched as top level constants. Otherwise, get constant under klass
class or module.
@j 定数 id の値を得る。
klass が Qnil なら、そのスコープで得られる定数の値を得る。
Qfalse なら、トップレベルスコープを得る。
それ以外なら、klass クラスの下の定数を得る。
*/
apparently introduced here: https://github.com/ruby/ruby/commit/d84f9b16946bca06ce0557ebe99152d7d445c9ec to resolve bug #10943
----------------------------------------
Bug #11718: Constant access on `nil`
https://bugs.ruby-lang.org/issues/11718#change-55042
* Author: Vais Salikhov
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
It is possible to access top-level constants by doing `nil::CONSTANT`, which looks like a bug [according to Matz](https://github.com/opal/opal/issues/1197#issuecomment-158078778). Here are a couple of examples:
```
$ ruby -ve "Foo = 123; p nil::Foo"
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
123
```
```
$ ruby -ve "class A; Foo = 456; end; p nil::A::Foo"
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
456
```
Thanks!
--
https://bugs.ruby-lang.org/