summaryrefslogtreecommitdiff
path: root/test/suite/sputnik/Conformance/10_Execution_Contexts/10.4_Establishing_An_Execution_Context/10.4.1_Global_Code/S10.2.1_A1_T1.js
blob: a45cca6ee765a0cd21cf192452ccadb20b7c769c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * @name: S10.2.1_A1_T1;
 * @section: 10.2.1;
 * @assertion: Variable instantiation is performed using the global object as
 * the variable object and using property attributes { DontDelete };
 * @description: Checking if deleting variable x, that is defined as var x = 1, fails;
 * @non_strict_only
*/

var x = 1;

if (this.x !== 1) {
  $ERROR("#1: variable x is a property of global object");
}

if(delete this.x !== false){
  $ERROR("#2: variable x has property attribute DontDelete");
}