mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* insns.def: fix to invoke nil.to_splat on NODE_ARGSCAT.
[ruby-dev:31138]. * bootstraptest/test_literal.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0d0ef6eccc
commit
b9171a73c4
4 changed files with 23 additions and 20 deletions
|
@ -1,3 +1,10 @@
|
|||
Fri Jul 6 02:08:25 2007 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* insns.def: fix to invoke nil.to_splat on NODE_ARGSCAT.
|
||||
[ruby-dev:31138].
|
||||
|
||||
* bootstraptest/test_literal.rb: add tests for above.
|
||||
|
||||
Thu Jul 5 19:45:55 2007 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* yarvcore.h: rename rb_control_frame_t#magic to flag.
|
||||
|
|
|
@ -113,6 +113,8 @@ assert_equal '1', 'a = [obj = Object.new]; a.size'
|
|||
assert_equal 'true', 'a = [obj = Object.new]; a[0] == obj'
|
||||
assert_equal '5', 'a = [1,2,3]; a[1] = 5; a[1]'
|
||||
assert_equal 'bar', '[*:foo];:bar'
|
||||
assert_equal '[1, 2]', 'def nil.to_splat; [2]; end; [1, *nil]'
|
||||
assert_equal '[1, 2]', 'def nil.to_splat; [1, 2]; end; [*nil]'
|
||||
|
||||
# hash
|
||||
assert_equal 'Hash', '{}.class'
|
||||
|
|
28
insns.def
28
insns.def
|
@ -555,27 +555,21 @@ concatarray
|
|||
(VALUE ary)
|
||||
{
|
||||
VALUE ary2 = ary2st;
|
||||
VALUE tmp1 = rb_check_convert_type(ary1, T_ARRAY, "Array", "to_splat");
|
||||
VALUE tmp2 = rb_check_convert_type(ary2, T_ARRAY, "Array", "to_splat");
|
||||
|
||||
if (ary2 == Qnil) {
|
||||
ary = ary1;
|
||||
if (NIL_P(tmp1)) {
|
||||
tmp1 = rb_ary_new3(1, ary1);
|
||||
}
|
||||
else {
|
||||
VALUE tmp1 = rb_check_convert_type(ary1, T_ARRAY, "Array", "to_splat");
|
||||
VALUE tmp2 = rb_check_convert_type(ary2, T_ARRAY, "Array", "to_splat");
|
||||
|
||||
if (NIL_P(tmp1)) {
|
||||
tmp1 = rb_ary_new3(1, ary1);
|
||||
}
|
||||
|
||||
if (NIL_P(tmp2)) {
|
||||
tmp2 = rb_ary_new3(1, ary2);
|
||||
}
|
||||
|
||||
if (tmp1 == ary1) {
|
||||
tmp1 = rb_ary_dup(ary1);
|
||||
}
|
||||
ary = rb_ary_concat(tmp1, tmp2);
|
||||
if (NIL_P(tmp2)) {
|
||||
tmp2 = rb_ary_new3(1, ary2);
|
||||
}
|
||||
|
||||
if (tmp1 == ary1) {
|
||||
tmp1 = rb_ary_dup(ary1);
|
||||
}
|
||||
ary = rb_ary_concat(tmp1, tmp2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#define RUBY_VERSION "1.9.0"
|
||||
#define RUBY_RELEASE_DATE "2007-07-05"
|
||||
#define RUBY_RELEASE_DATE "2007-07-06"
|
||||
#define RUBY_VERSION_CODE 190
|
||||
#define RUBY_RELEASE_CODE 20070705
|
||||
#define RUBY_RELEASE_CODE 20070706
|
||||
#define RUBY_PATCHLEVEL 0
|
||||
|
||||
#define RUBY_VERSION_MAJOR 1
|
||||
|
@ -9,7 +9,7 @@
|
|||
#define RUBY_VERSION_TEENY 0
|
||||
#define RUBY_RELEASE_YEAR 2007
|
||||
#define RUBY_RELEASE_MONTH 7
|
||||
#define RUBY_RELEASE_DAY 5
|
||||
#define RUBY_RELEASE_DAY 6
|
||||
|
||||
#ifdef RUBY_EXTERN
|
||||
RUBY_EXTERN const char ruby_version[];
|
||||
|
|
Loading…
Reference in a new issue