Debian Codegraph @

rhino/testsrc/tests/e4x/Regress/regress-370372.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-370372.js';
8
9 var BUGNUMBER = 370372;
10 var summary = 'with (xmllist) function::name assignments';
11 var actual = 'No Exception';
12 var expect = 'No Exception';
13
14 printBugNumber(BUGNUMBER);
15 START(summary);
16
17 var tests = [<></>, <><a/></>, <><a/><b/></>];
18
19 function do_one(x)
20 {
21 x.function::f = Math.sin;
22 with (x) {
23 function::toString = function::f = function() { return "test"; };
24 }
25
26 if (String(x) !== "test")
27 throw "Failed to set toString";
28
29 if (x.f() !== "test")
30 throw "Failed to set set function f";
31
32 if (x.function::toString != x.function::f)
33 throw "toString and f are different";
34 }
35
36
37 for (var i = 0; i != tests.length; ++i)
38 do_one(tests[i]);
39
40 TEST(1, expect, actual);
41 END();