js/src/tests/ecma/String/15.5.3.2-2.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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:          15.5.3.2-2.js
     9    ECMA Section:       15.5.3.2  String.fromCharCode( char0, char1, ... )
    10    Description:        Return a string value containing as many characters
    11    as the number of arguments.  Each argument specifies
    12    one character of the resulting string, with the first
    13    argument specifying the first character, and so on,
    14    from left to right.  An argument is converted to a
    15    character by applying the operation ToUint16_t and
    16    regarding the resulting 16bit integeras the Unicode
    17    encoding of a character.  If no arguments are supplied,
    18    the result is the empty string.
    20    This tests String.fromCharCode with multiple arguments.
    22    Author:             christine@netscape.com
    23    Date:               2 october 1997
    24 */
    26 var SECTION = "15.5.3.2-2";
    27 var VERSION = "ECMA_1";
    28 startTest();
    29 var TITLE   = "String.fromCharCode()";
    31 writeHeaderToLog( SECTION + " "+ TITLE);
    33 new TestCase( SECTION,
    34 	      "var MYSTRING = String.fromCharCode(eval(\"var args=''; for ( i = 0x0020; i < 0x007f; i++ ) { args += ( i == 0x007e ) ? i : i + ', '; } args;\")); MYSTRING",
    35 	      " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",
    36 	      eval( "var MYSTRING = String.fromCharCode(" + eval("var args=''; for ( i = 0x0020; i < 0x007f; i++ ) { args += ( i == 0x007e ) ? i : i + ', '; } args;") +"); MYSTRING" ));
    38 new TestCase( SECTION,
    39 	      "MYSTRING.length",
    40 	      0x007f - 0x0020,
    41 	      MYSTRING.length );
    43 test();

mercurial