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/
8 /* Direct calls to eval should inherit the strictness of the calling code. */
9 assertEq(testLenientAndStrict("eval('010')",
11 raisesException(SyntaxError)),
15 * Directives in the eval code itself should always override a direct
16 * caller's strictness.
18 assertEq(testLenientAndStrict("eval('\"use strict\"; 010')",
19 raisesException(SyntaxError),
20 raisesException(SyntaxError)),
23 /* Code passed to indirect calls to eval should never be strict. */
24 assertEq(testLenientAndStrict("var evil=eval; evil('010')",
30 * Code passed to the Function constructor never inherits the caller's
33 assertEq(completesNormally("Function('010')"),
35 assertEq(raisesException(SyntaxError)("Function('\"use strict\"; 010')"),
39 * If 'eval' causes a frame's primitive |this| to become wrapped, the frame should see the same
40 * wrapper object as the eval code.
42 var call_this, eval_this;
45 * At this point, a primitive |this| has not yet been wrapped. A
46 * reference to |this| from the eval call should wrap it, and the wrapper
47 * should be stored where the call frame can see it.
52 f.call(true, 'eval_this = this');
53 assertEq(call_this, eval_this);
55 reportCompare(true, true);
57 var successfullyParsed = true;