summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-19 14:22:27 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-19 14:22:27 +0000
commitd102ce6d09908fef31b2728abfa81de05aa4239b (patch)
treedc7913c0f26455b734eea5817356f240eaa20888 /array.c
parente664d467a92df0e7655c453c0eda9bc7fd1e1884 (diff)
* eval.c (rb_eval): need not to clar method cache for NODE_CLASS,
NODE_SCLASS. * gc.c (obj_free): need not to clear method cache on class/module finalization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/array.c b/array.c
index e13ad25..e1e1f92 100644
--- a/array.c
+++ b/array.c
@@ -550,7 +550,8 @@ rb_ary_fetch(argc, argv, ary)
idx += RARRAY(ary)->len;
}
if (idx < 0 || RARRAY(ary)->len <= idx) {
- return ifnone;
+ if (argc == 2) return ifnone;
+ rb_raise(rb_eIndexError, "index %d out of array", idx);
}
return RARRAY(ary)->ptr[idx];
}