diff --git a/lib/raven/okjson.rb b/lib/raven/okjson.rb index dc0fcef09..1d36733cb 100644 --- a/lib/raven/okjson.rb +++ b/lib/raven/okjson.rb @@ -278,7 +278,8 @@ def numtok(s) elsif m[2] [:val, m[0], Float(m[0])] else - [:val, m[0], Integer(m[1])*(10**m[3][1..-1].to_i(10))] + # We don't convert scientific notation + [:val, m[0], m[0]] end else [] @@ -609,4 +610,4 @@ class Error < ::StandardError Spc = ' '[0] Unesc = {?b=>?\b, ?f=>?\f, ?n=>?\n, ?r=>?\r, ?t=>?\t} end -end \ No newline at end of file +end diff --git a/spec/raven/okjson_spec.rb b/spec/raven/okjson_spec.rb index 31d7155a0..cb02035dc 100644 --- a/spec/raven/okjson_spec.rb +++ b/spec/raven/okjson_spec.rb @@ -20,8 +20,8 @@ end end - it 'parses zero-leading exponent numbers correctly' do - expect(Raven::OkJson.decode("[123e090]")).to eq [123000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000] + it 'does not parse scientific notation' do + expect(Raven::OkJson.decode("[123e090]")).to eq ["123e090"] end it 'it raises the correct error on strings that look like incomplete objects' do