1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
4 * Any copyright is dedicated to the Public Domain.
5 * http://creativecommons.org/licenses/publicdomain/
9 * 'with' statements are forbidden in strict top-level code. This is
10 * eval code, but that's close enough.
12 assertEq(testLenientAndStrict('with (1) {}',
14 raisesException(SyntaxError)),
17 /* 'with' statements are forbidden in strict function code. */
18 assertEq(testLenientAndStrict('function f() { "use strict"; with (1) {} }',
19 parseRaisesException(SyntaxError),
20 parseRaisesException(SyntaxError)),
24 * A use strict directive in a function mustn't affect the strictness
27 assertEq(parsesSuccessfully('function f() { "use strict"; }; with (1) {}'),
30 reportCompare(true, true);
32 var successfullyParsed = true;