Debian Codegraph @

rhino/testsrc/tests/js1_3/Script/new-001.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 gTestfile = 'new-001.js';
7
8 /**
9 File Name: new-001.js
10 Section:
11 Description:
12
13 http://scopus.mcom.com/bugsplat/show_bug.cgi?id=76103
14
15 Author: [email protected]
16 Date: 12 november 1997
17 */
18 var SECTION = "new-001";
19 var VERSION = "JS1_3";
20 var TITLE = "new-001";
21 var BUGNUMBER="31567";
22
23 startTest();
24 writeHeaderToLog( SECTION + " "+ TITLE);
25
26 function Test_One (x) {
27 this.v = x+1;
28 return x*2
29 }
30
31 function Test_Two( x, y ) {
32 this.v = x;
33 return y;
34 }
35
36 new TestCase(
37 SECTION,
38 "Test_One(18)",
39 36,
40 Test_One(18) );
41
42 new TestCase(
43 SECTION,
44 "new Test_One(18)",
45 "[object Object]",
46 new Test_One(18) +"" );
47
48 new TestCase(
49 SECTION,
50 "new Test_One(18).v",
51 19,
52 new Test_One(18).v );
53
54 new TestCase(
55 SECTION,
56 "Test_Two(2,7)",
57 7,
58 Test_Two(2,7) );
59
60 new TestCase(
61 SECTION,
62 "new Test_Two(2,7)",
63 "[object Object]",
64 new Test_Two(2,7) +"" );
65
66 new TestCase(
67 SECTION,
68 "new Test_Two(2,7).v",
69 2,
70 new Test_Two(2,7).v );
71
72 new TestCase(
73 SECTION,
74 "new (Function)(\"x\", \"return x+3\")(5,6)",
75 8,
76 new (Function)("x","return x+3")(5,6) );
77
78 new TestCase(
79 SECTION,
80 "new new Test_Two(String, 2).v(0123)",
81 "83",
82 new new Test_Two(String, 2).v(0123) +"");
83
84 new TestCase(
85 SECTION,
86 "new new Test_Two(String, 2).v(0123).length",
87 2,
88 new new Test_Two(String, 2).v(0123).length );
89
90 test();