Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2889277
JSON.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
654 B
Referenced Files
None
Subscribers
None
JSON.js
View Options
/**
* @requires javelin-json
*/
describe
(
'JSON'
,
function
()
{
it
(
'should encode and decode an object'
,
function
()
{
var
object
=
{
a
:
[
0
,
1
,
2
],
s
:
'Javelin Stuffs'
,
u
:
'\x01'
,
n
:
1
,
f
:
3.14
,
b
:
false
,
nil
:
null
,
o
:
{
a
:
1
,
b
:
[
1
,
2
],
c
:
{
a
:
2
,
b
:
3
}
}
};
expect
(
JX
.
JSON
.
parse
(
JX
.
JSON
.
stringify
(
object
))).
toEqual
(
object
);
});
it
(
'should encode undefined array indices as null'
,
function
()
{
var
a
=
[];
a
.
length
=
2
;
var
o
=
{
x
:
a
};
expect
(
JX
.
JSON
.
stringify
(
o
)).
toEqual
(
'{"x":[null,null]}'
);
});
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jan 19 2025, 11:55 (4 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1124296
Default Alt Text
JSON.js (654 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment