js/src/tests/js1_3/Script/new-001.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6
michael@0 7 /**
michael@0 8 File Name: new-001.js
michael@0 9 Section:
michael@0 10 Description:
michael@0 11
michael@0 12 http://scopus.mcom.com/bugsplat/show_bug.cgi?id=76103
michael@0 13
michael@0 14 Author: christine@netscape.com
michael@0 15 Date: 12 november 1997
michael@0 16 */
michael@0 17 var SECTION = "new-001";
michael@0 18 var VERSION = "JS1_3";
michael@0 19 var TITLE = "new-001";
michael@0 20 var BUGNUMBER="31567";
michael@0 21
michael@0 22 startTest();
michael@0 23 writeHeaderToLog( SECTION + " "+ TITLE);
michael@0 24
michael@0 25 function Test_One (x) {
michael@0 26 this.v = x+1;
michael@0 27 return x*2
michael@0 28 }
michael@0 29
michael@0 30 function Test_Two( x, y ) {
michael@0 31 this.v = x;
michael@0 32 return y;
michael@0 33 }
michael@0 34
michael@0 35 new TestCase(
michael@0 36 SECTION,
michael@0 37 "Test_One(18)",
michael@0 38 36,
michael@0 39 Test_One(18) );
michael@0 40
michael@0 41 new TestCase(
michael@0 42 SECTION,
michael@0 43 "new Test_One(18)",
michael@0 44 "[object Object]",
michael@0 45 new Test_One(18) +"" );
michael@0 46
michael@0 47 new TestCase(
michael@0 48 SECTION,
michael@0 49 "new Test_One(18).v",
michael@0 50 19,
michael@0 51 new Test_One(18).v );
michael@0 52
michael@0 53 new TestCase(
michael@0 54 SECTION,
michael@0 55 "Test_Two(2,7)",
michael@0 56 7,
michael@0 57 Test_Two(2,7) );
michael@0 58
michael@0 59 new TestCase(
michael@0 60 SECTION,
michael@0 61 "new Test_Two(2,7)",
michael@0 62 "[object Object]",
michael@0 63 new Test_Two(2,7) +"" );
michael@0 64
michael@0 65 new TestCase(
michael@0 66 SECTION,
michael@0 67 "new Test_Two(2,7).v",
michael@0 68 2,
michael@0 69 new Test_Two(2,7).v );
michael@0 70
michael@0 71 new TestCase(
michael@0 72 SECTION,
michael@0 73 "new (Function)(\"x\", \"return x+3\")(5,6)",
michael@0 74 8,
michael@0 75 new (Function)("x","return x+3")(5,6) );
michael@0 76
michael@0 77 new TestCase(
michael@0 78 SECTION,
michael@0 79 "new new Test_Two(String, 2).v(0123)",
michael@0 80 "83",
michael@0 81 new new Test_Two(String, 2).v(0123) +"");
michael@0 82
michael@0 83 new TestCase(
michael@0 84 SECTION,
michael@0 85 "new new Test_Two(String, 2).v(0123).length",
michael@0 86 2,
michael@0 87 new new Test_Two(String, 2).v(0123).length );
michael@0 88
michael@0 89 test();

mercurial