diff options
author | Florian Frank <flori@ping.de> | 2011-12-20 23:05:15 +0100 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2011-12-20 23:05:15 +0100 |
commit | aa7feb07b68e13ce2e024669873a8a6a89f304dc (patch) | |
tree | 6c11497c2c6e417cbb56705fb96c7366e6fc58fb /ext/json/ext/parser/parser.c | |
parent | dec1286737e8d9c3d61ec9f6726a88d65592f48e (diff) | |
download | json-aa7feb07b68e13ce2e024669873a8a6a89f304dc.tar.gz |
Support duck typed ruby array in JRuby as well
Diffstat (limited to 'ext/json/ext/parser/parser.c')
-rw-r--r-- | ext/json/ext/parser/parser.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c index e262f09..c572a95 100644 --- a/ext/json/ext/parser/parser.c +++ b/ext/json/ext/parser/parser.c @@ -445,12 +445,12 @@ case 26: 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))) { |