Skip to content

Commit 24d6f38

Browse files
committed
Merge pull request #230 from getsentry/fix-229
Fix OKJson issue with exponent notation Close #229
2 parents 93bc2a2 + e75ba39 commit 24d6f38

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/raven/okjson.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def numtok(s)
272272
elsif m[2]
273273
[:val, m[0], Float(m[0])]
274274
else
275-
[:val, m[0], Integer(m[1])*(10**Integer(m[3][1..-1]))]
275+
[:val, m[0], Integer(m[1])*(10**m[3][1..-1].to_i(10))]
276276
end
277277
else
278278
[]

spec/raven/okjson_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@
2020
end
2121
end
2222

23+
it 'parses zero-leading exponent numbers correctly' do
24+
expect(Raven::OkJson.decode("[123e090]")).to eq [123000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000]
25+
end
26+
2327
end

0 commit comments

Comments
 (0)