Debian Codegraph @

js/src/tests/test262/language/global-code/S10.4.1_A1_T1.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: |
6 Variable instantiation is performed using the global object as
7 the variable object and using property attributes { DontDelete }
8 es5id: 10.4.1_A1_T1
9 description: >
10 Checking if deleting variable x, that is defined as var x = 1,
11 fails
12 flags: [noStrict]
13 ---*/
14
15 var x = 1;
16
17 if (this.x !== 1) {
18 throw new Test262Error("#1: variable x is a property of global object");
19 }
20
21 if(delete this.x !== false){
22 throw new Test262Error("#2: variable x has property attribute DontDelete");
23 }
24
25 reportCompare(0, 0);