|
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 * TypeError is subclass of Error from instanceof operator point of view |
|
6 * |
|
7 * @path ch11/11.8/11.8.6/S11.8.6_A5_T2.js |
|
8 * @description Checking TypeError case |
|
9 */ |
|
10 |
|
11 var __t__err = new TypeError; |
|
12 |
|
13 //CHECK#1 |
|
14 if (!(__t__err instanceof Error)) { |
|
15 $ERROR('#1: TypeError is subclass of Error from instanceof operator poit of view'); |
|
16 } |
|
17 |
|
18 //CHECK#2 |
|
19 if (!(__t__err instanceof TypeError)) { |
|
20 $ERROR('#2: TypeError is subclass of Error from instanceof operator poit of view'); |
|
21 } |
|
22 |
|
23 ////////////////////////////////////////////////////////////////////////////// |
|
24 var err__t__ = TypeError('failed'); |
|
25 |
|
26 //CHECK#3 |
|
27 if (!(err__t__ instanceof Error)) { |
|
28 $ERROR('#3: TypeError is subclass of Error from instanceof operator poit of view'); |
|
29 } |
|
30 |
|
31 //CHECK#4 |
|
32 if (!(err__t__ instanceof TypeError)) { |
|
33 $ERROR('#4: TypeError is subclass of Error from instanceof operator poit of view'); |
|
34 } |
|
35 |
|
36 |