js/src/tests/test262/ch12/12.10/S12.10_A5_T2.js

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:20d54b969406
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 * Deleting property using "eval" statement containing "with" statement
6 *
7 * @path ch12/12.10/S12.10_A5_T2.js
8 * @description Deleting number property
9 * @noStrict
10 */
11
12 this.p1 = 'a';
13 var myObj = {
14 p1: 1,
15 del:false
16 }
17 eval("with(myObj){del = delete p1}");
18
19 //////////////////////////////////////////////////////////////////////////////
20 //CHECK#1
21 if(myObj.p1 === 1){
22 $ERROR('#1: myObj.p1 !== 1');
23 }
24 //
25 //////////////////////////////////////////////////////////////////////////////
26
27 //////////////////////////////////////////////////////////////////////////////
28 //CHECK#2
29 if(myObj.p1 !== undefined){
30 $ERROR('#2: myObj.p1 === undefined . Actual: myObj.p1 ==='+ myObj.p1 );
31 }
32 //
33 //////////////////////////////////////////////////////////////////////////////
34
35 //////////////////////////////////////////////////////////////////////////////
36 //CHECK#3
37 if(myObj.del !== true){
38 $ERROR('#3: myObj.del === true. Actual: myObj.del ===. Actual: myObj.del ==='+ myObj.del +myObj.del);
39 }
40 //
41 //////////////////////////////////////////////////////////////////////////////
42
43 //////////////////////////////////////////////////////////////////////////////
44 //CHECK#4
45 if(myObj.p1 === 'a'){
46 $ERROR('#4: myObj.p1 !== \'a\'');
47 }
48 //
49 //////////////////////////////////////////////////////////////////////////////
50

mercurial