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