Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 null value must throw TypeError
6 *
7 * @path ch09/9.9/S9.9_A2.js
8 * @description Trying to convert null to Object
9 * @noStrict
10 */
12 // CHECK#1
13 try{
14 null['foo'];
15 $ERROR('#1.1: null[\'foo\'] throw TypeError. Actual: ' + (null['foo']));
16 }
17 catch(e){
18 if((e instanceof TypeError) !== true){
19 $ERROR('#1.2: null[\'foo\'] must throw TypeError. Actual: ' + (e));
20 }
21 }
23 // CHECK#2
24 try{
25 with(null) x = 2;
26 $ERROR('#2.1: with(null) x = 2 must throw TypeError. Actual: x === . Actual: ' + (x));
27 }
28 catch(e){
29 if((e instanceof TypeError) !== true){
30 $ERROR('#2.2: with(null) x = 2 must throw TypeError. Actual: ' + (e));
31 }
32 }