mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
849 B
48 lines
849 B
/*===
|
|
[]
|
|
[]
|
|
[null]
|
|
[
|
|
null
|
|
]
|
|
[null,null]
|
|
[
|
|
null,
|
|
null
|
|
]
|
|
[null,null,null]
|
|
[
|
|
null,
|
|
null,
|
|
null
|
|
]
|
|
[null,"foo",null,"bar",null]
|
|
[
|
|
null,
|
|
"foo",
|
|
null,
|
|
"bar",
|
|
null
|
|
]
|
|
===*/
|
|
|
|
function arrayUndefinedTest() {
|
|
print(JSON.stringify([]));
|
|
print(JSON.stringify([], null, 2));
|
|
print(JSON.stringify([undefined]));
|
|
print(JSON.stringify([undefined], null, 2));
|
|
print(JSON.stringify([undefined,undefined]));
|
|
print(JSON.stringify([undefined,undefined], null, 2));
|
|
print(JSON.stringify([undefined,undefined,undefined]));
|
|
print(JSON.stringify([undefined,undefined,undefined], null, 2));
|
|
|
|
print(JSON.stringify([undefined, 'foo', undefined, 'bar', undefined]));
|
|
print(JSON.stringify([undefined, 'foo', undefined, 'bar', undefined], null, 2));
|
|
}
|
|
|
|
try {
|
|
arrayUndefinedTest();
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
|
|
|