Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/instanceof/S11.8.6_A5_T1.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: TypeError is subclass of Error from instanceof operator point of view
6 es5id: 11.8.6_A5_T1
7 description: Checking Error case
8 ---*/
9
10 var __err = new Error;
11
12 //////////////////////////////////////////////////////////////////////////////
13 //CHECK#1
14 if (!(__err instanceof Error)) {
15 $ERROR('#1: TypeError is subclass of Error from instanceof operator point of view');
16 }
17 //
18 //////////////////////////////////////////////////////////////////////////////
19
20 //////////////////////////////////////////////////////////////////////////////
21 //CHECK#2
22 if (__err instanceof TypeError) {
23 $ERROR('#2: TypeError is subclass of Error from instanceof operator point of view');
24 }
25 //
26 //////////////////////////////////////////////////////////////////////////////
27
28 var err__ = Error('failed');
29
30 //////////////////////////////////////////////////////////////////////////////
31 //CHECK#3
32 if (!(err__ instanceof Error)) {
33 $ERROR('#3: TypeError is subclass of Error from instanceof operator point of view');
34 }
35 //
36 //////////////////////////////////////////////////////////////////////////////
37
38 //////////////////////////////////////////////////////////////////////////////
39 //CHECK#4
40 if (err__ instanceof TypeError) {
41 $ERROR('#4: TypeError is subclass of Error from instanceof operator point of view');
42 }
43 //
44 //////////////////////////////////////////////////////////////////////////////