Debian Codegraph @

rhino/testsrc/tests/ecma_3/Object/8.6.2.6-002.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 = '8.6.2.6-002.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 470364;
9 var summary = '[[DefaultValue]] should not call valueOf, toString with an argument';
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 = actual = 'No exception';
25
26 try
27 {
28 var o = {
29 valueOf: function()
30 {
31 if (arguments.length !== 0)
32 throw "unexpected arguments! arg1 type=" + typeof arguments[0] + ", value=" +
33 arguments[0];
34 return 2;
35 }
36 };
37 o + 3;
38 }
39 catch(ex)
40 {
41 actual = ex + '';
42 }
43
44 reportCompare(expect, actual, summary);
45
46 exitFunc ('test');
47 }