2011-09-07 08:35:18 +02:00
|
|
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
2014-07-22 01:09:02 +02:00
|
|
|
/*---
|
2018-01-05 18:26:51 +01:00
|
|
|
info: |
|
2014-07-22 01:09:02 +02:00
|
|
|
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}
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 12.2_A2
|
2014-07-22 01:09:02 +02:00
|
|
|
description: >
|
|
|
|
Checking if deleting global variables that have the attributes
|
|
|
|
{DontDelete} fails
|
2015-03-23 17:34:52 +01:00
|
|
|
flags: [noStrict]
|
2014-07-22 01:09:02 +02:00
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//CHECK#1
|
|
|
|
if (delete(__variable)) {
|
2021-07-22 21:58:54 +02:00
|
|
|
throw new Test262Error('#1: delete(__variable)===false');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//CHECK#2
|
|
|
|
if (delete(this["__variable"])) {
|
2021-07-22 21:58:54 +02:00
|
|
|
throw new Test262Error('#2: delete(this["__variable"])===false');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
var __variable;
|
|
|
|
var __variable = "defined";
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//CHECK#3
|
|
|
|
if (delete(__variable) | delete(this["__variable"])) {
|
2021-07-22 21:58:54 +02:00
|
|
|
throw new Test262Error('#3: (delete(__variable) | delete(this["__variable"]))===false' );
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//CHECK#4
|
|
|
|
if ((__variable !== "defined")|(this["__variable"] !=="defined")) {
|
2021-07-22 21:58:54 +02:00
|
|
|
throw new Test262Error('#4: __variable === "defined" and this["__variable"] ==="defined"');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|