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
|
|
|
/*---
|
|
|
|
info: If the property has the DontDelete attribute, return false
|
2020-09-11 17:58:45 +02:00
|
|
|
esid: sec-delete-operator-runtime-semantics-evaluation
|
2014-07-22 01:09:02 +02:00
|
|
|
description: Checking declared variable
|
2014-12-11 18:01:59 +01:00
|
|
|
flags: [noStrict]
|
2014-07-22 01:09:02 +02:00
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
//CHECK#1
|
|
|
|
var x = 1;
|
|
|
|
if (delete x !== false) {
|
2021-07-28 22:48:39 +02:00
|
|
|
throw new Test262Error('#1: var x = 1; delete x === false');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//CHECK#2
|
|
|
|
var y = 1;
|
|
|
|
if (delete this.y !== false) {
|
2021-07-28 22:48:39 +02:00
|
|
|
throw new Test262Error('#2: var y = 1; delete this.y === false');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//CHECK#3
|
2020-09-11 17:58:45 +02:00
|
|
|
function MyFunction() {}
|
2011-09-07 08:35:18 +02:00
|
|
|
if (delete MyFunction !== false) {
|
2021-07-28 22:48:39 +02:00
|
|
|
throw new Test262Error('#3: function MyFunction(){}; delete MyFunction === false');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//CHECK#4
|
|
|
|
var MyObject = new MyFunction();
|
|
|
|
if (delete MyObject !== false) {
|
2021-07-28 22:48:39 +02:00
|
|
|
throw new Test262Error(
|
2020-09-11 17:58:45 +02:00
|
|
|
'#4: function MyFunction(){}; var MyObject = new MyFunction(); delete MyObject === false'
|
|
|
|
);
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|