mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (ev_const_get): retrieve Object's constant if no current
class is available (e.g. defining singleton class for Fixnums). * eval.c (proc_call): ignore block to `call' always, despite of being orphan or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8dd4317ebd
commit
d251ea2d91
4 changed files with 20 additions and 22 deletions
12
ChangeLog
12
ChangeLog
|
|
@ -1,3 +1,15 @@
|
|||
Tue Feb 27 16:38:15 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (ev_const_get): retrieve Object's caonstat if no current
|
||||
class is available (e.g. defining singleton class for Fixnums).
|
||||
|
||||
* eval.c (proc_call): ignore block to `call' always, despite of
|
||||
being orphan or not.
|
||||
|
||||
Mon Feb 26 16:20:27 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* ruby.c (proc_options): call ruby_show_version() just once.
|
||||
|
||||
Mon Feb 26 00:04:52 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (proc_call): should not modify ruby_block->frame.iter
|
||||
|
|
|
|||
12
eval.c
12
eval.c
|
|
@ -1450,6 +1450,7 @@ ev_const_get(cref, id)
|
|||
while (cbase && cbase->nd_clss != rb_cObject) {
|
||||
struct RClass *klass = RCLASS(cbase->nd_clss);
|
||||
|
||||
if (NIL_P(klass)) return rb_const_get(rb_cObject, id);
|
||||
if (klass->iv_tbl && st_lookup(klass->iv_tbl, id, &result)) {
|
||||
return result;
|
||||
}
|
||||
|
|
@ -6275,19 +6276,12 @@ proc_call(proc, args)
|
|||
Data_Get_Struct(proc, struct BLOCK, data);
|
||||
orphan = blk_orphan(data);
|
||||
|
||||
if (orphan) {/* orphan procedure */
|
||||
if (rb_block_given_p()) {
|
||||
ruby_block->frame.iter = ITER_CUR;
|
||||
}
|
||||
else {
|
||||
ruby_block->frame.iter = ITER_NOT;
|
||||
}
|
||||
}
|
||||
|
||||
/* PUSH BLOCK from data */
|
||||
old_block = ruby_block;
|
||||
_block = *data;
|
||||
ruby_block = &_block;
|
||||
ruby_block->frame.iter = ITER_NOT;
|
||||
|
||||
PUSH_ITER(ITER_CUR);
|
||||
ruby_frame->iter = ITER_CUR;
|
||||
|
||||
|
|
|
|||
14
lib/Env.rb
14
lib/Env.rb
|
|
@ -6,19 +6,7 @@
|
|||
# $USER = "matz"
|
||||
# p ENV["USER"]
|
||||
|
||||
for k,v in ENV
|
||||
next unless /^[a-zA-Z][_a-zA-Z0-9]*/ =~ k
|
||||
eval <<EOS
|
||||
$#{k} = %q!#{v}!
|
||||
trace_var "$#{k}", proc{|v|
|
||||
ENV[%q!#{k}!] = v;
|
||||
$#{k} = v
|
||||
if v == nil
|
||||
untrace_var "$#{k}"
|
||||
end
|
||||
}
|
||||
EOS
|
||||
end
|
||||
require 'importenv'
|
||||
|
||||
if __FILE__ == $0
|
||||
p $TERM
|
||||
|
|
|
|||
4
ruby.c
4
ruby.c
|
|
@ -430,6 +430,10 @@ proc_options(argc, argv)
|
|||
goto reswitch;
|
||||
|
||||
case 'v':
|
||||
if (verbose) {
|
||||
s++;
|
||||
goto reswitch;
|
||||
}
|
||||
ruby_show_version();
|
||||
verbose = 1;
|
||||
case 'w':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue