Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/delete/S8.12.7_A2_T2.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 and if O doesn't have a property with name P, return true
8 es5id: 8.12.7_A2_T2
9 description: >
10 Try to delete not existent properties of O, but existent property
11 of prototype
12 ---*/
13
14 function Palette(){};
15 Palette.prototype = {red:0xFF0000, green:0x00FF00};
16 var __palette = new Palette;
17
18 //////////////////////////////////////////////////////////////////////////////
19 //CHECK#1
20 if (__palette.red !== 0xFF0000){
21 $ERROR('#1: function Palette(){}; Palette.prototype = {red:0xFF0000, green:0x00FF00}; __palette = new Palette; __palette.red === 0xFF0000. Actual: ' + (__palette.red));
22 }
23 //
24 //////////////////////////////////////////////////////////////////////////////
25
26 //////////////////////////////////////////////////////////////////////////////
27 //CHECK#2
28 if (delete __palette.red !== true) {
29 $ERROR('#2 function Palette(){}; Palette.prototype = {red:0xFF0000, green:0x00FF00}; __palette = new Palette; delete __palette.red === true. Actual: ' + (delete __palette.red));
30 }
31 //
32 //////////////////////////////////////////////////////////////////////////////
33
34 //////////////////////////////////////////////////////////////////////////////
35 //CHECK#3
36 if (__palette.red !== 0xFF0000){
37 $ERROR('#3: function Palette(){}; Palette.prototype = {red:0xFF0000, green:0x00FF00}; __palette = new Palette; __palette.red === 0xFF0000. Actual: ' + (__palette.red));
38 }
39 //
40 //////////////////////////////////////////////////////////////////////////////