Debian Codegraph @

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