michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * Variables are defined with global scope (that is, they are created as members of the global object, as described in 10.1.3) using property attributes { DontDelete} michael@0: * michael@0: * @path ch12/12.2/S12.2_A2.js michael@0: * @description Checking if deleting global variables that have the attributes {DontDelete} fails michael@0: */ michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: if (delete(__variable)) { michael@0: $ERROR('#1: delete(__variable)===false'); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#2 michael@0: if (delete(this["__variable"])) { michael@0: $ERROR('#2: delete(this["__variable"])===false'); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: michael@0: var __variable; michael@0: var __variable = "defined"; michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#3 michael@0: if (delete(__variable) | delete(this["__variable"])) { michael@0: $ERROR('#3: (delete(__variable) | delete(this["__variable"]))===false' ); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#4 michael@0: if ((__variable !== "defined")|(this["__variable"] !=="defined")) { michael@0: $ERROR('#4: __variable === "defined" and this["__variable"] ==="defined"'); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: