1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/js1_3/Script/new-001.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,89 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 + 1.10 +/** 1.11 + File Name: new-001.js 1.12 + Section: 1.13 + Description: 1.14 + 1.15 + http://scopus.mcom.com/bugsplat/show_bug.cgi?id=76103 1.16 + 1.17 + Author: christine@netscape.com 1.18 + Date: 12 november 1997 1.19 +*/ 1.20 +var SECTION = "new-001"; 1.21 +var VERSION = "JS1_3"; 1.22 +var TITLE = "new-001"; 1.23 +var BUGNUMBER="31567"; 1.24 + 1.25 +startTest(); 1.26 +writeHeaderToLog( SECTION + " "+ TITLE); 1.27 + 1.28 +function Test_One (x) { 1.29 + this.v = x+1; 1.30 + return x*2 1.31 + } 1.32 + 1.33 +function Test_Two( x, y ) { 1.34 + this.v = x; 1.35 + return y; 1.36 +} 1.37 + 1.38 +new TestCase( 1.39 + SECTION, 1.40 + "Test_One(18)", 1.41 + 36, 1.42 + Test_One(18) ); 1.43 + 1.44 +new TestCase( 1.45 + SECTION, 1.46 + "new Test_One(18)", 1.47 + "[object Object]", 1.48 + new Test_One(18) +"" ); 1.49 + 1.50 +new TestCase( 1.51 + SECTION, 1.52 + "new Test_One(18).v", 1.53 + 19, 1.54 + new Test_One(18).v ); 1.55 + 1.56 +new TestCase( 1.57 + SECTION, 1.58 + "Test_Two(2,7)", 1.59 + 7, 1.60 + Test_Two(2,7) ); 1.61 + 1.62 +new TestCase( 1.63 + SECTION, 1.64 + "new Test_Two(2,7)", 1.65 + "[object Object]", 1.66 + new Test_Two(2,7) +"" ); 1.67 + 1.68 +new TestCase( 1.69 + SECTION, 1.70 + "new Test_Two(2,7).v", 1.71 + 2, 1.72 + new Test_Two(2,7).v ); 1.73 + 1.74 +new TestCase( 1.75 + SECTION, 1.76 + "new (Function)(\"x\", \"return x+3\")(5,6)", 1.77 + 8, 1.78 + new (Function)("x","return x+3")(5,6) ); 1.79 + 1.80 +new TestCase( 1.81 + SECTION, 1.82 + "new new Test_Two(String, 2).v(0123)", 1.83 + "83", 1.84 + new new Test_Two(String, 2).v(0123) +""); 1.85 + 1.86 +new TestCase( 1.87 + SECTION, 1.88 + "new new Test_Two(String, 2).v(0123).length", 1.89 + 2, 1.90 + new new Test_Two(String, 2).v(0123).length ); 1.91 + 1.92 +test();