Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Merge pull request #9126 from mbarb0sa/bugfix/json-decoding-i…

…n-rails-3-0-stable"

This reverts commit 360af4e, reversing
changes made to f93d046.
  • Loading branch information...
commit f2839f1dbafc7c8b0bdceb6c636f5d44b7d686bc 1 parent 182d4e3
@tenderlove tenderlove authored
View
2  activesupport/lib/active_support/json/backends/jsongem.rb
@@ -12,7 +12,7 @@ def decode(json)
if json.respond_to?(:read)
json = json.read
end
- data = ::JSON.load(json)
+ data = ::JSON.parse(json)
if ActiveSupport.parse_json_times
convert_dates_from(data)
else
View
1  activesupport/lib/active_support/json/backends/okjson.rb
@@ -63,7 +63,6 @@ def textparse(ts)
typ, _, val = ts[0]
case typ
- when :str, :val then valparse(ts)
when '{' then objparse(ts)
when '[' then arrparse(ts)
else
View
11 activesupport/test/json/decoding_test.rb
@@ -51,10 +51,7 @@ class TestJSONDecoding < ActiveSupport::TestCase
# tests escaping of "\n" char with Yaml backend
%q({"a":"\n"}) => {"a"=>"\n"},
%q({"a":"\u000a"}) => {"a"=>"\n"},
- %q({"a":"Line1\u000aLine2"}) => {"a"=>"Line1\nLine2"},
- "\"foobar\"" => "foobar",
- "42" => 42,
- "null" => nil
+ %q({"a":"Line1\u000aLine2"}) => {"a"=>"Line1\nLine2"}
}
# load the default JSON backend
@@ -90,11 +87,5 @@ class TestJSONDecoding < ActiveSupport::TestCase
def test_failed_json_decoding
assert_raise(ActiveSupport::JSON.parse_error) { ActiveSupport::JSON.decode(%({: 1})) }
end
-
- def test_decoding_of_json_encoded_string
- assert_equal "foobar", ActiveSupport::JSON.decode(ActiveSupport::JSON.encode("foobar"))
- assert_equal 42, ActiveSupport::JSON.decode(ActiveSupport::JSON.encode(42))
- assert_equal nil, ActiveSupport::JSON.decode(ActiveSupport::JSON.encode(nil))
- end
end
Please sign in to comment.
Something went wrong with that request. Please try again.