| 1 |
/* -*- indent-tabs-mode: nil; js-indent-level: 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: [email protected] |
| 15 |
Date: 12 november 1997 |
| 16 |
*/ |
| 17 |
var SECTION = "new-001"; |
| 18 |
var TITLE = "new-001"; |
| 19 |
var BUGNUMBER="31567"; |
| 20 |
|
| 21 |
printBugNumber(BUGNUMBER); |
| 22 |
writeHeaderToLog( SECTION + " "+ TITLE); |
| 23 |
|
| 24 |
function Test_One (x) { |
| 25 |
this.v = x+1; |
| 26 |
return x*2 |
| 27 |
} |
| 28 |
|
| 29 |
function Test_Two( x, y ) { |
| 30 |
this.v = x; |
| 31 |
return y; |
| 32 |
} |
| 33 |
|
| 34 |
new TestCase( |
| 35 |
"Test_One(18)", |
| 36 |
36, |
| 37 |
Test_One(18) ); |
| 38 |
|
| 39 |
new TestCase( |
| 40 |
"new Test_One(18)", |
| 41 |
"[object Object]", |
| 42 |
new Test_One(18) +"" ); |
| 43 |
|
| 44 |
new TestCase( |
| 45 |
"new Test_One(18).v", |
| 46 |
19, |
| 47 |
new Test_One(18).v ); |
| 48 |
|
| 49 |
new TestCase( |
| 50 |
"Test_Two(2,7)", |
| 51 |
7, |
| 52 |
Test_Two(2,7) ); |
| 53 |
|
| 54 |
new TestCase( |
| 55 |
"new Test_Two(2,7)", |
| 56 |
"[object Object]", |
| 57 |
new Test_Two(2,7) +"" ); |
| 58 |
|
| 59 |
new TestCase( |
| 60 |
"new Test_Two(2,7).v", |
| 61 |
2, |
| 62 |
new Test_Two(2,7).v ); |
| 63 |
|
| 64 |
new TestCase( |
| 65 |
"new (Function)(\"x\", \"return x+3\")(5,6)", |
| 66 |
8, |
| 67 |
new (Function)("x","return x+3")(5,6) ); |
| 68 |
|
| 69 |
new TestCase( |
| 70 |
"new new Test_Two(String, 2).v(0123)", |
| 71 |
"83", |
| 72 |
new new Test_Two(String, 2).v(0123) +""); |
| 73 |
|
| 74 |
new TestCase( |
| 75 |
"new new Test_Two(String, 2).v(0123).length", |
| 76 |
2, |
| 77 |
new new Test_Two(String, 2).v(0123).length ); |
| 78 |
|
| 79 |
test(); |