1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/ecma_5/strict/12.14.1.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,37 @@ 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 +/* 1.12 + * In strict mode, the identifier bound by a 'catch' clause may not 1.13 + * be 'eval' or 'arguments'. 1.14 + */ 1.15 +assertEq(testLenientAndStrict('try{}catch(eval){}', 1.16 + parsesSuccessfully, 1.17 + parseRaisesException(SyntaxError)), 1.18 + true); 1.19 +assertEq(testLenientAndStrict('try{}catch([eval]){}', 1.20 + parsesSuccessfully, 1.21 + parseRaisesException(SyntaxError)), 1.22 + true); 1.23 +assertEq(testLenientAndStrict('try{}catch({x:eval}){}', 1.24 + parsesSuccessfully, 1.25 + parseRaisesException(SyntaxError)), 1.26 + true); 1.27 +assertEq(testLenientAndStrict('try{}catch(arguments){}', 1.28 + parsesSuccessfully, 1.29 + parseRaisesException(SyntaxError)), 1.30 + true); 1.31 +assertEq(testLenientAndStrict('try{}catch([arguments]){}', 1.32 + parsesSuccessfully, 1.33 + parseRaisesException(SyntaxError)), 1.34 + true); 1.35 +assertEq(testLenientAndStrict('try{}catch({x:arguments}){}', 1.36 + parsesSuccessfully, 1.37 + parseRaisesException(SyntaxError)), 1.38 + true); 1.39 + 1.40 +reportCompare(true, true);