mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 07:26:00 +02:00
error.c: preserve encoding
* error.c (rb_error_frozen_object): preserve encoding of class name in error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d9a597408f
commit
8b9afe6520
3 changed files with 20 additions and 1 deletions
|
@ -255,13 +255,14 @@ PRINTF_ARGS(void rb_compile_error(const char*, int, const char*, ...), 3, 4);
|
|||
PRINTF_ARGS(void rb_compile_error_with_enc(const char*, int, void *, const char*, ...), 4, 5);
|
||||
PRINTF_ARGS(void rb_compile_error_append(const char*, ...), 1, 2);
|
||||
NORETURN(void rb_error_frozen(const char*));
|
||||
NORETURN(void rb_error_frozen_object(VALUE));
|
||||
void rb_error_untrusted(VALUE);
|
||||
void rb_check_frozen(VALUE);
|
||||
void rb_check_trusted(VALUE);
|
||||
#define rb_check_frozen_internal(obj) do { \
|
||||
VALUE frozen_obj = (obj); \
|
||||
if (OBJ_FROZEN(frozen_obj)) { \
|
||||
rb_error_frozen(rb_obj_classname(frozen_obj)); \
|
||||
rb_error_frozen_object(frozen_obj); \
|
||||
} \
|
||||
} while (0)
|
||||
#define rb_check_trusted_internal(obj) ((void) 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue