yuwei5380 / jsonplugin

Automatically exported from code.google.com/p/jsonplugin
0 stars 0 forks source link

JavaScript unsupported the "long" type #69

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
JavaScript unsupported the "long" type, eg: 
alert(eval("1234567890123456789")); display: 1234567890123456700
Could convert long to String:
eg:
{id:1234567890123456789} convert to {id:'1234567890123456789'}

What is the expected output? What do you see instead?
{id:'1234567890123456789'} instead of {id:1234567890123456789}

What version of the product are you using? On what operating system?
using jsonplugin 0.19, struts 2.0.11

Original issue reported on code.google.com by liangfei...@gmail.com on 12 Nov 2008 at 2:23

GoogleCodeExporter commented 8 years ago
Numeric values should be serialized as numbers, not strings. If the gap between 
java
and javascript is a problem, then it should be the developer's task to 
serialize as
strings. I understand the problem, but we are choosing the lesser of the 2 
evils here.

Original comment by musa...@gmail.com on 27 Nov 2008 at 5:47