Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /**
5 * ToObject conversion from undefined value must throw TypeError
6 *
7 * @path ch09/9.9/S9.9_A1.js
8 * @description Trying to convert undefined to Object
9 * @noStrict
10 */
12 // CHECK#1
13 try{
14 undefined['foo'];
15 $ERROR('#1.1: undefined[\'foo\'] must throw TypeError. Actual: ' + (undefined['foo']));
16 }
17 catch(e){
18 if((e instanceof TypeError) !== true){
19 $ERROR('#1.2: undefined[\'foo\'] must throw TypeError. Actual: ' + (e));
20 }
21 }
23 // CHECK#2
24 try{
25 with(undefined) x = 2;
26 $ERROR('#2.1: with(undefined) x = 2 must throw TypeError. Actual: x === ' + (x));
27 }
28 catch(e){
29 if((e instanceof TypeError) !== true){
30 $ERROR('#2.2: with(undefined) x = 2 must throw TypeError. Actual: ' + (e));
31 }
32 }