| 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 |
When the [[Delete]] method of O is called with property name P, |
| 7 |
removes the property with name P from O and return true |
| 8 |
esid: sec-delete-operator-runtime-semantics-evaluation |
| 9 |
description: Delete existent properties |
| 10 |
---*/ |
| 11 |
|
| 12 |
var BLUE_NUM = 1; |
| 13 |
var BLUE_STR = '1'; |
| 14 |
var YELLOW_NUM = 2; |
| 15 |
var YELLOW_STR = '2'; |
| 16 |
var __color__map = { |
| 17 |
red: 0xff0000, |
| 18 |
BLUE_NUM: 0x0000ff, |
| 19 |
green: 0x00ff00, |
| 20 |
YELLOW_STR: 0xffff00, |
| 21 |
}; |
| 22 |
|
| 23 |
////////////////////////////////////////////////////////////////////////////// |
| 24 |
//CHECK#1 |
| 25 |
if (delete __color__map[YELLOW_NUM] !== true) { |
| 26 |
throw new Test262Error( |
| 27 |
'#1: var BLUE_NUM=1; var BLUE_STR="1"; var YELLOW_NUM=2; var YELLOW_STR="2"; var __color__map = {red:0xFF0000, BLUE_NUM:0x0000FF, green:0x00FF00, YELLOW_STR:0xFFFF00}; delete __color__map[YELLOW_NUM] === true;' |
| 28 |
); |
| 29 |
} |
| 30 |
// |
| 31 |
////////////////////////////////////////////////////////////////////////////// |
| 32 |
|
| 33 |
////////////////////////////////////////////////////////////////////////////// |
| 34 |
//CHECK#2 |
| 35 |
if (__color__map[YELLOW_STR] !== undefined) { |
| 36 |
throw new Test262Error( |
| 37 |
'#2: var BLUE_NUM=1; var BLUE_STR="1"; var YELLOW_NUM=2; var YELLOW_STR="2"; var __color__map = {red:0xFF0000, BLUE_NUM:0x0000FF, green:0x00FF00, YELLOW_STR:0xFFFF00}; delete __color__map[YELLOW_NUM]; __color__map[YELLOW_STR] === undefined. Actual: ' + |
| 38 |
__color__map[YELLOW_STR] |
| 39 |
); |
| 40 |
} |
| 41 |
// |
| 42 |
////////////////////////////////////////////////////////////////////////////// |
| 43 |
|
| 44 |
////////////////////////////////////////////////////////////////////////////// |
| 45 |
//CHECK#3 |
| 46 |
if (delete __color__map[BLUE_STR] !== true) { |
| 47 |
throw new Test262Error( |
| 48 |
'#3: var BLUE_NUM=1; var BLUE_STR="1"; var YELLOW_NUM=2; var YELLOW_STR="2"; var __color__map = {red:0xFF0000, BLUE_NUM:0x0000FF, green:0x00FF00, YELLOW_STR:0xFFFF00}; delete __color__map[BLUE_STR] === true. Actual: ' + |
| 49 |
delete __color__map[BLUE_STR] |
| 50 |
); |
| 51 |
} |
| 52 |
// |
| 53 |
////////////////////////////////////////////////////////////////////////////// |
| 54 |
|
| 55 |
////////////////////////////////////////////////////////////////////////////// |
| 56 |
//CHECK#4 |
| 57 |
if (__color__map[BLUE_NUM] !== undefined) { |
| 58 |
throw new Test262Error( |
| 59 |
'#4: var BLUE_NUM=1; var BLUE_STR="1"; var YELLOW_NUM=2; var YELLOW_STR="2"; var __color__map = {red:0xFF0000, BLUE_NUM:0x0000FF, green:0x00FF00, YELLOW_STR:0xFFFF00}; delete __color__map[BLUE_STR]; __color__map[BLUE_NUM] === undefined. Actual: ' + |
| 60 |
__color__map[BLUE_NUM] |
| 61 |
); |
| 62 |
} |
| 63 |
// |
| 64 |
////////////////////////////////////////////////////////////////////////////// |
| 65 |
|
| 66 |
reportCompare(0, 0); |