Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-281606.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 var gTestfile = 'regress-281606.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 281606;
9 var summary = 'l instanceof r throws TypeError if r does not support [[HasInstance]]';
10 var actual = '';
11 var expect = '';
12 var status;
13
14 printBugNumber(BUGNUMBER);
15 printStatus (summary);
16
17 var o = {};
18
19 status = summary + ' ' + inSection(1) + ' o instanceof Math ';
20 expect = 'TypeError';
21 try
22 {
23 if (o instanceof Math)
24 {
25 }
26 actual = 'No Error';
27 }
28 catch(e)
29 {
30 actual = e.name;
31 }
32 reportCompare(expect, actual, status);
33
34 status = summary + ' ' + inSection(2) + ' o instanceof o ';
35 expect = 'TypeError';
36 try
37 {
38 if (o instanceof o)
39 {
40 }
41 actual = 'No Error';
42 }
43 catch(e)
44 {
45 actual = e.name;
46 }
47 reportCompare(expect, actual, status);