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.

     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/. */
     7 /**
     8    File Name:          new-001.js
     9    Section:
    10    Description:
    12    http://scopus.mcom.com/bugsplat/show_bug.cgi?id=76103
    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";
    22 startTest();
    23 writeHeaderToLog( SECTION + " "+ TITLE);
    25 function Test_One (x) {
    26   this.v = x+1;
    27   return x*2
    28     }
    30 function Test_Two( x, y ) {
    31   this.v = x;
    32   return y;
    33 }
    35 new TestCase(
    36   SECTION,
    37   "Test_One(18)",
    38   36,
    39   Test_One(18) );
    41 new TestCase(
    42   SECTION,
    43   "new Test_One(18)",
    44   "[object Object]",
    45   new Test_One(18) +"" );
    47 new TestCase(
    48   SECTION,
    49   "new Test_One(18).v",
    50   19,
    51   new Test_One(18).v );
    53 new TestCase(
    54   SECTION,
    55   "Test_Two(2,7)",
    56   7,
    57   Test_Two(2,7) );
    59 new TestCase(
    60   SECTION,
    61   "new Test_Two(2,7)",
    62   "[object Object]",
    63   new Test_Two(2,7) +"" );
    65 new TestCase(
    66   SECTION,
    67   "new Test_Two(2,7).v",
    68   2,
    69   new Test_Two(2,7).v );
    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) );
    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) +"");
    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 );
    89 test();

mercurial