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.
 
 
 
 
 
 

26 lines
323 B

/*===
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);
}