Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/instanceof/S11.8.6_A5_T2.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_T2
7 description: Checking TypeError case
8 ---*/
9
10 var __t__err = new TypeError;
11
12 //CHECK#1
13 if (!(__t__err instanceof Error)) {
14 $ERROR('#1: TypeError is subclass of Error from instanceof operator point of view');
15 }
16
17 //CHECK#2
18 if (!(__t__err instanceof TypeError)) {
19 $ERROR('#2: TypeError is subclass of Error from instanceof operator point of view');
20 }
21
22 //////////////////////////////////////////////////////////////////////////////
23 var err__t__ = TypeError('failed');
24
25 //CHECK#3
26 if (!(err__t__ instanceof Error)) {
27 $ERROR('#3: TypeError is subclass of Error from instanceof operator point of view');
28 }
29
30 //CHECK#4
31 if (!(err__t__ instanceof TypeError)) {
32 $ERROR('#4: TypeError is subclass of Error from instanceof operator point of view');
33 }