js/src/tests/ecma/Number/0x-without-following-hexdigits.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:9e6375471d43
1 // Any copyright is dedicated to the Public Domain.
2 // http://creativecommons.org/licenses/publicdomain/
3
4 //-----------------------------------------------------------------------------
5 var BUGNUMBER = 582643;
6 var summary = "'0x' not followed by hex digits should be a syntax error";
7
8 print(BUGNUMBER + ": " + summary);
9
10 /**************
11 * BEGIN TEST *
12 **************/
13
14 try
15 {
16 eval("0x");
17 throw new Error("didn't throw parsing 0x (with no subsequent hex digits)");
18 }
19 catch (e)
20 {
21 assertEq(e instanceof SyntaxError, true,
22 "bad exception thrown: " + e);
23 }
24
25 /******************************************************************************/
26
27 if (typeof reportCompare === "function")
28 reportCompare(true, true);
29
30 print("All tests passed!");

mercurial