|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 |
|
3 /* |
|
4 * Any copyright is dedicated to the Public Domain. |
|
5 * http://creativecommons.org/licenses/publicdomain/ |
|
6 */ |
|
7 |
|
8 /* Octal integer literal at top level. */ |
|
9 assertEq(testLenientAndStrict('010', |
|
10 parsesSuccessfully, |
|
11 parseRaisesException(SyntaxError)), |
|
12 true); |
|
13 |
|
14 /* Octal integer literal in strict function body */ |
|
15 assertEq(parseRaisesException(SyntaxError) |
|
16 ('function f() { "use strict"; 010; }'), |
|
17 true); |
|
18 |
|
19 |
|
20 /* |
|
21 * Octal integer literal after strict function body (restoration of |
|
22 * scanner state) |
|
23 */ |
|
24 assertEq(parsesSuccessfully('function f() { "use strict"; }; 010'), |
|
25 true); |
|
26 |
|
27 /* Octal integer literal in function body */ |
|
28 assertEq(parsesSuccessfully('function f() { 010; }'), |
|
29 true); |
|
30 |
|
31 reportCompare(true, true); |