Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/delete/S8.12.7_A3.js

raw
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 es5id: 8.12.7_A3
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 = {red:0xFF0000, BLUE_NUM:0x0000FF, green:0x00FF00, YELLOW_STR:0xFFFF00};
17
18 //////////////////////////////////////////////////////////////////////////////
19 //CHECK#1
20 if (delete __color__map[YELLOW_NUM] !== true){
21 $ERROR('#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;');
22 };
23 //
24 //////////////////////////////////////////////////////////////////////////////
25
26 //////////////////////////////////////////////////////////////////////////////
27 //CHECK#2
28 if (__color__map[YELLOW_STR] !== undefined) {
29 $ERROR('#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: ' + (__color__map[YELLOW_STR]));
30 }
31 //
32 //////////////////////////////////////////////////////////////////////////////
33
34 //////////////////////////////////////////////////////////////////////////////
35 //CHECK#3
36 if (delete __color__map[BLUE_STR] !== true){
37 $ERROR('#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: ' + (delete __color__map[BLUE_STR]));
38 };
39 //
40 //////////////////////////////////////////////////////////////////////////////
41
42 //////////////////////////////////////////////////////////////////////////////
43 //CHECK#4
44 if (__color__map[BLUE_NUM] !== undefined) {
45 $ERROR('#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: ' + (__color__map[BLUE_NUM]));
46 }
47 //
48 //////////////////////////////////////////////////////////////////////////////