From b9432e7630f3a85944730b3ba1b1aa4a8a753612 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 29 Aug 2010 03:51:39 +0000 Subject: * load.c (rb_provide_feature): clarify error message for frozen $LOADED_FEATURES. based on a patch from Run Paint Run Run at [ruby-core:31913]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- load.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'load.c') diff --git a/load.c b/load.c index c956977527..11fcaa4023 100644 --- a/load.c +++ b/load.c @@ -250,6 +250,10 @@ rb_feature_provided(const char *feature, const char **loading) static void rb_provide_feature(VALUE feature) { + if (OBJ_FROZEN(get_loaded_features())) { + rb_raise(rb_eRuntimeError, + "$LOADED_FEATURES is frozen; cannot append feature"); + } rb_ary_push(get_loaded_features(), feature); } -- cgit v1.2.3