Debian Codegraph @

rhino/testsrc/tests/e4x/Regress/regress-369740.js

raw symbols SCIP
1 /* -*- Mode: java; tab-width:8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 gTestfile = 'regress-369740.js';
8
9 var BUGNUMBER = 369740;
10 var summary = 'generic code for function::';
11 var actual = 'No Exception';
12 var expect = 'No Exception';
13
14 printBugNumber(BUGNUMBER);
15 START(summary);
16
17 actual = expect = Math.function::sin + '';
18 TEST(1, expect, actual);
19
20 var x = <xml/>;
21 x.function::toString = function(){return "moo"};
22 actual = x + '';
23 expect = 'moo';
24 TEST(2, expect, actual);
25
26 x = <><a/><b/></>;
27
28 expect = 'test';
29 try
30 {
31 with (x) {
32 function::toString = function() { return "test"; }
33 }
34
35 actual = x + '';
36 }
37 catch(ex)
38 {
39 actual = ex + '';
40 }
41 TEST(3, expect, actual);
42
43 // test for regression caused by initial patch
44 expect = actual = 'No Crash';
45 const xhtmlNS = null;
46 this[xhtmlNS] = {};
47 TEST(4, expect, actual);
48
49
50 END();