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.
18 lines
510 B
18 lines
510 B
/*===
|
|
SyntaxError
|
|
===*/
|
|
|
|
try {
|
|
// Hex prefix without digits -> SyntaxError. One could also interpret
|
|
// this as an octal number (0) followed by an 'x'.
|
|
//
|
|
// In fact, with the interpretation that one should parse the longest
|
|
// valid prefix, this might be the correct interpretation if one
|
|
// supports octal numbers. This doesn't really matter because a valid
|
|
// number (0) followed by 'x' would be a SyntaxError anyway.
|
|
|
|
print(eval('0x'));
|
|
} catch(e) {
|
|
print(e.name);
|
|
}
|
|
|
|
|