Debian Codegraph @

js/src/tests/test262/built-ins/undefined/15.1.1.3-2-strict.js

raw
1 'use strict';
2 // Copyright (c) 2012 Ecma International. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-undefined
7 description: undefined is not writable, should throw TypeError in strict mode
8 flags: [onlyStrict]
9 ---*/
10
11 var global = this;
12
13 assert.throws(TypeError, function() {
14 global["undefined"] = 5; // Should throw a TypeError as per 8.12.5
15 });
16 assert.sameValue(global["undefined"], void 0);
17 assert.sameValue(undefined, void 0);
18
19 reportCompare(0, 0);