12.10-2-4.js (607B)
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: ToObject conversion from undefined value must throw TypeError 6 es5id: 12.10-2-4 7 description: Trying to convert undefined to Object 8 flags: [noStrict] 9 ---*/ 10 11 try{ 12 with(undefined) x = 2; 13 throw new Test262Error('#2.1: with(undefined) x = 2 must throw TypeError. Actual: x === ' + (x)); 14 } 15 catch(e){ 16 if((e instanceof TypeError) !== true){ 17 throw new Test262Error('#2.2: with(undefined) x = 2 must throw TypeError. Actual: ' + (e)); 18 } 19 } 20 21 reportCompare(0, 0);