summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-18 08:05:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-18 08:05:53 +0000
commit13f5dcb9f25cf07ef22baa5aded490395700b283 ()
tree5678b3e222c96077a2eb8e7a80e21dd5dbef1d3e /error.c
parent2627c19d82252f2bb571f6bcb44e359cacefa92b (diff)
error.c: KeyError#receiver and KeyError#key
* error.c: new method KeyError#receiver and KeyError#key. [Feature #12063] * hash.c: make KeyError object with receiver and key. * sprintf.c: ditto. Author: ksss <[email protected]> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--error.c36
1 files changed, 35 insertions, 1 deletions
@@ -815,7 +815,7 @@ VALUE rb_mErrno;
static VALUE rb_eNOERROR;
static ID id_new, id_cause, id_message, id_backtrace;
-static ID id_name, id_args, id_Errno, id_errno, id_i_path;
static ID id_receiver, id_iseq, id_local_variables;
static ID id_private_call_p;
extern ID ruby_static_id_status;
@@ -1547,6 +1547,37 @@ rb_invalid_str(const char *str, const char *type)
rb_raise(rb_eArgError, "invalid value for %s: %+"PRIsVALUE, type, s);
}
/*
* call-seq:
* SyntaxError.new([msg]) -> syntax_error
@@ -2161,6 +2192,8 @@ Init_Exception(void)
rb_eArgError = rb_define_class("ArgumentError", rb_eStandardError);
rb_eIndexError = rb_define_class("IndexError", rb_eStandardError);
rb_eKeyError = rb_define_class("KeyError", rb_eIndexError);
rb_eRangeError = rb_define_class("RangeError", rb_eStandardError);
rb_eScriptError = rb_define_class("ScriptError", rb_eException);
@@ -2216,6 +2249,7 @@ Init_Exception(void)
id_message = rb_intern_const("message");
id_backtrace = rb_intern_const("backtrace");
id_name = rb_intern_const("name");
id_args = rb_intern_const("args");
id_receiver = rb_intern_const("receiver");
id_private_call_p = rb_intern_const("private_call?");