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
|
|
|
"This" operator doesn't use GetValue. The operators "delete" and "typeof"
|
|
|
|
can be applied to parenthesised expressions
|
2014-12-11 18:01:59 +01:00
|
|
|
es5id: 11.1.6_A2_T1
|
2014-07-22 01:09:02 +02:00
|
|
|
description: >
|
|
|
|
Applying "delete" and "typeof" operators to an undefined variable
|
|
|
|
and a property of an object
|
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
//CHECK#1
|
|
|
|
if (typeof (x) !== "undefined") {
|
2014-12-11 18:01:59 +01:00
|
|
|
$ERROR('#1: typeof (x) === "undefined". Actual: ' + (typeof (x)));
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var object = {};
|
2014-12-11 18:01:59 +01:00
|
|
|
//CHECK#2
|
2011-09-07 08:35:18 +02:00
|
|
|
if (delete (object.prop) !== true) {
|
2014-12-11 18:01:59 +01:00
|
|
|
$ERROR('#2: var object = {}; delete (object.prop) === true');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
2014-12-11 18:01:59 +01:00
|
|
|
//CHECK#3
|
2011-09-07 08:35:18 +02:00
|
|
|
if (typeof (object.prop) !== "undefined") {
|
2014-12-11 18:01:59 +01:00
|
|
|
$ERROR('#3: var object = {}; typeof (object.prop) === "undefined". Actual: ' + (typeof (object.prop)));
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|