| 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: "[[hasProperty]] is sensitive to property existence but [[Get]] is not" |
| 6 |
es5id: 8.12.6_A3 |
| 7 |
description: > |
| 8 |
Use [[hasProperty]] and [[Get]] for existent and not existent |
| 9 |
properties |
| 10 |
---*/ |
| 11 |
|
| 12 |
var __obj={}; __obj.hole=undefined; |
| 13 |
|
| 14 |
////////////////////////////////////////////////////////////////////////////// |
| 15 |
//CHECK#1 |
| 16 |
if (__obj.hole !== undefined) { |
| 17 |
$ERROR('#1: var __obj={}; __obj.hole=undefined; __obj.hole === undefined. Actual: ' + (__obj.hole)); |
| 18 |
} |
| 19 |
// |
| 20 |
////////////////////////////////////////////////////////////////////////////// |
| 21 |
|
| 22 |
////////////////////////////////////////////////////////////////////////////// |
| 23 |
//CHECK#2 |
| 24 |
if (__obj.notexist !== undefined) { |
| 25 |
$ERROR('#2: var __obj={}; __obj.hole=undefined; __obj.notexist === undefined. Actual: ' + (__obj.notexist)); |
| 26 |
} |
| 27 |
// |
| 28 |
////////////////////////////////////////////////////////////////////////////// |
| 29 |
|
| 30 |
////////////////////////////////////////////////////////////////////////////// |
| 31 |
//CHECK#3 |
| 32 |
if (!("hole" in __obj)) { |
| 33 |
$ERROR('#3: var __obj={}; __obj.hole=undefined; "hole" in __obj'); |
| 34 |
} |
| 35 |
// |
| 36 |
////////////////////////////////////////////////////////////////////////////// |
| 37 |
|
| 38 |
////////////////////////////////////////////////////////////////////////////// |
| 39 |
//CHECK#4 |
| 40 |
if (("notexist" in __obj)) { |
| 41 |
$ERROR('#4: var __obj={}; __obj.hole=undefined; "notexist" in __obj'); |
| 42 |
} |
| 43 |
// |
| 44 |
////////////////////////////////////////////////////////////////////////////// |