Debian Codegraph @

rhino/testsrc/tests/js1_8/regress/regress-465220.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-465220.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 465220;
9 var summary = 'Do not assert: anti-nesting';
10 var actual = '';
11 var expect = '';
12
13
14 //-----------------------------------------------------------------------------
15 test();
16 //-----------------------------------------------------------------------------
17
18 function test()
19 {
20 enterFunc ('test');
21 printBugNumber(BUGNUMBER);
22 printStatus (summary);
23
24 expect = 'TypeError: can\'t convert o to primitive type';
25
26 jit(true);
27
28 try
29 {
30 var o = {toString: function()(i > 2) ? this : "foo"};
31 var s = "";
32 for (var i = 0; i < 5; i++)
33 s += o + o;
34 print(s);
35 actual = 'No Exception';
36 }
37 catch(ex)
38 {
39 actual = 'TypeError: can\'t convert o to primitive type';
40 }
41 jit(false);
42
43 reportCompare(expect, actual, summary);
44
45 exitFunc ('test');
46 }