Debian Codegraph @

js/src/tests/test262/language/directive-prologue/10.1.1-11-s.js

raw
1 // Copyright (c) 2012 Ecma International. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 es5id: 10.1.1-11-s
6 description: >
7 Strict Mode - Eval code is strict code with a Use Strict Directive
8 at the beginning of the block
9 flags: [noStrict]
10 ---*/
11
12 var err = null;
13
14 try {
15 eval("'use strict'; var public = 1; var anotherVariableNotReserveWord = 2;");
16 } catch (e) {
17 err = e;
18 }
19
20 assert(err instanceof SyntaxError, 'err instanceof SyntaxError');
21 assert.sameValue(typeof public, "undefined", 'typeof public');
22 assert.sameValue(typeof anotherVariableNotReserveWord, "undefined", 'typeof anotherVariableNotReserveWord');
23
24 reportCompare(0, 0);