Debian Codegraph @

js/src/tests/test262/language/eval-code/indirect/always-non-strict-strict.js

raw
1 'use strict';
2 // Copyright (C) 2016 the V8 project authors. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 description: Strictness of direct eval is not dependent on strictness of caller
6 esid: sec-strict-mode-code
7 info: |
8 Eval code is strict mode code if it begins with a Directive Prologue that
9 contains a Use Strict Directive or if the call to eval is a direct eval
10 that is contained in strict mode code.
11 flags: [onlyStrict]
12 ---*/
13
14 var count = 0;
15
16 (0,eval)('var static; count += 1;');
17
18 assert.sameValue(count, 1);
19
20 (0,eval)('with ({}) {} count += 1;');
21
22 assert.sameValue(count, 2);
23
24 (0,eval)('unresolvable = null; count += 1;');
25
26 assert.sameValue(count, 3);
27
28 reportCompare(0, 0);