From 1069e5d665599ce60086f284b575d3a850ed2b01 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 5 Feb 2011 02:29:18 +0000 Subject: * ext/json/parser/parser.h (GET_PARSER): raise TypeError. * ext/json/parser/parser.rl (cParser_initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/json/parser/parser.c | 2 +- ext/json/parser/parser.h | 2 +- ext/json/parser/parser.rl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/json/parser') diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c index 22c8167fc7..418c1c32f0 100644 --- a/ext/json/parser/parser.c +++ b/ext/json/parser/parser.c @@ -1613,7 +1613,7 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self) GET_PARSER_INIT; if (json->Vsource) { - rb_raise(rb_eArgError, "already initialized instance"); + rb_raise(rb_eTypeError, "already initialized instance"); } rb_scan_args(argc, argv, "11", &source, &opts); source = convert_encoding(StringValue(source)); diff --git a/ext/json/parser/parser.h b/ext/json/parser/parser.h index 5d4532b948..a344da058c 100644 --- a/ext/json/parser/parser.h +++ b/ext/json/parser/parser.h @@ -45,7 +45,7 @@ typedef struct JSON_ParserStruct { #define GET_PARSER \ GET_PARSER_INIT; \ - if (!json->Vsource) rb_raise(rb_eArgError, "uninitialized instance") + if (!json->Vsource) rb_raise(rb_eTypeError, "uninitialized instance") #define GET_PARSER_INIT \ JSON_Parser *json; \ Data_Get_Struct(self, JSON_Parser, json) diff --git a/ext/json/parser/parser.rl b/ext/json/parser/parser.rl index 680242732e..278386432b 100644 --- a/ext/json/parser/parser.rl +++ b/ext/json/parser/parser.rl @@ -611,7 +611,7 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self) GET_PARSER_INIT; if (json->Vsource) { - rb_raise(rb_eArgError, "already initialized instance"); + rb_raise(rb_eTypeError, "already initialized instance"); } rb_scan_args(argc, argv, "11", &source, &opts); source = convert_encoding(StringValue(source)); -- cgit v1.2.3