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.
27 lines
323 B
27 lines
323 B
12 years ago
|
/*===
|
||
|
1
|
||
|
1
|
||
|
SyntaxError
|
||
|
===*/
|
||
|
|
||
|
/* Allow leading and trailing whitespace, but no other garbage */
|
||
|
|
||
|
try {
|
||
|
print(JSON.parse('1'));
|
||
|
} catch (e) {
|
||
|
print(e.name);
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
print(JSON.parse('\t\n 1 \t\n'));
|
||
|
} catch (e) {
|
||
|
print(e.name);
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
print(JSON.parse('1 x'));
|
||
|
} catch (e) {
|
||
|
print(e.name);
|
||
|
}
|
||
|
|