1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/ecma_5/strict/B.1.1.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,31 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 + 1.6 +/* 1.7 + * Any copyright is dedicated to the Public Domain. 1.8 + * http://creativecommons.org/licenses/publicdomain/ 1.9 + */ 1.10 + 1.11 +/* Octal integer literal at top level. */ 1.12 +assertEq(testLenientAndStrict('010', 1.13 + parsesSuccessfully, 1.14 + parseRaisesException(SyntaxError)), 1.15 + true); 1.16 + 1.17 +/* Octal integer literal in strict function body */ 1.18 +assertEq(parseRaisesException(SyntaxError) 1.19 + ('function f() { "use strict"; 010; }'), 1.20 + true); 1.21 + 1.22 + 1.23 +/* 1.24 + * Octal integer literal after strict function body (restoration of 1.25 + * scanner state) 1.26 + */ 1.27 +assertEq(parsesSuccessfully('function f() { "use strict"; }; 010'), 1.28 + true); 1.29 + 1.30 +/* Octal integer literal in function body */ 1.31 +assertEq(parsesSuccessfully('function f() { 010; }'), 1.32 + true); 1.33 + 1.34 +reportCompare(true, true);