summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2011-12-20 22:28:12 +0100
committerFlorian Frank <flori@ping.de>2011-12-20 22:28:12 +0100
commitdec1286737e8d9c3d61ec9f6726a88d65592f48e (patch)
tree8295668fa08d8aeadec6e9380bda960d0c2307cb /ext
parent43460e877f3759af36bc541433ddb6b32d510116 (diff)
downloadjson-dec1286737e8d9c3d61ec9f6726a88d65592f48e.tar.gz
Support hash ducktype objects on JRuby as well
Diffstat (limited to 'ext')
-rw-r--r--ext/json/ext/parser/parser.rl10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/json/ext/parser/parser.rl b/ext/json/ext/parser/parser.rl
index 1bee5bd..5838dac 100644
--- a/ext/json/ext/parser/parser.rl
+++ b/ext/json/ext/parser/parser.rl
@@ -167,12 +167,12 @@ static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *resu
if (cs >= JSON_object_first_final) {
if (json->create_additions) {
- VALUE klassname;
+ VALUE klassname;
if (NIL_P(json->object_class)) {
- klassname = rb_hash_aref(*result, json->create_id);
- } else {
- klassname = rb_funcall(*result, i_aref, 1, json->create_id);
- }
+ klassname = rb_hash_aref(*result, json->create_id);
+ } else {
+ klassname = rb_funcall(*result, i_aref, 1, json->create_id);
+ }
if (!NIL_P(klassname)) {
VALUE klass = rb_funcall(mJSON, i_deep_const_get, 1, klassname);
if (RTEST(rb_funcall(klass, i_json_creatable_p, 0))) {