| 1 |
// Copyright 2009 the Sputnik authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
info: | |
| 6 |
"This" operator doesn't use GetValue. The operators "delete" and "typeof" |
| 7 |
can be applied to parenthesised expressions |
| 8 |
es5id: 11.1.6_A2_T1 |
| 9 |
description: > |
| 10 |
Applying "delete" and "typeof" operators to an undefined variable |
| 11 |
and a property of an object |
| 12 |
---*/ |
| 13 |
|
| 14 |
//CHECK#1 |
| 15 |
if (typeof (x) !== "undefined") { |
| 16 |
$ERROR('#1: typeof (x) === "undefined". Actual: ' + (typeof (x))); |
| 17 |
} |
| 18 |
|
| 19 |
var object = {}; |
| 20 |
//CHECK#2 |
| 21 |
if (delete (object.prop) !== true) { |
| 22 |
$ERROR('#2: var object = {}; delete (object.prop) === true'); |
| 23 |
} |
| 24 |
|
| 25 |
//CHECK#3 |
| 26 |
if (typeof (object.prop) !== "undefined") { |
| 27 |
$ERROR('#3: var object = {}; typeof (object.prop) === "undefined". Actual: ' + (typeof (object.prop))); |
| 28 |
} |