diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-02-19 21:20:15 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-02-19 21:20:15 +0100 |
commit | d8f1ee4b41352b870f617b01099b2877f754d32c (patch) | |
tree | dd6bdf1d1ded6aab7bb926109a24e942fc740b73 /activesupport/lib/active_support/json/decoding.rb | |
parent | 8ba1fc18e13c03966d411947180022c1730e81ff (diff) | |
parent | 7c0e008973e594ebf53607362c1dfbe34b693600 (diff) | |
download | rails-d8f1ee4b41352b870f617b01099b2877f754d32c.tar.gz rails-d8f1ee4b41352b870f617b01099b2877f754d32c.tar.bz2 rails-d8f1ee4b41352b870f617b01099b2877f754d32c.zip |
Merge commit 'mainstream/master'
Diffstat (limited to 'activesupport/lib/active_support/json/decoding.rb')
-rw-r--r-- | activesupport/lib/active_support/json/decoding.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/json/decoding.rb b/activesupport/lib/active_support/json/decoding.rb index 9da4048272..5eb8c0fd7d 100644 --- a/activesupport/lib/active_support/json/decoding.rb +++ b/activesupport/lib/active_support/json/decoding.rb @@ -46,10 +46,11 @@ module ActiveSupport json.gsub(/\\\//, '/') else left_pos = [-1].push(*marks) - right_pos = marks << json.length + right_pos = marks << scanner.pos + scanner.rest_size output = [] left_pos.each_with_index do |left, i| - output << json[left.succ..right_pos[i]] + scanner.pos = left.succ + output << scanner.peek(right_pos[i] - scanner.pos + 1) end output = output * " " |