michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: /** michael@0: File Name: 15.5.3.2-2.js michael@0: ECMA Section: 15.5.3.2 String.fromCharCode( char0, char1, ... ) michael@0: Description: Return a string value containing as many characters michael@0: as the number of arguments. Each argument specifies michael@0: one character of the resulting string, with the first michael@0: argument specifying the first character, and so on, michael@0: from left to right. An argument is converted to a michael@0: character by applying the operation ToUint16_t and michael@0: regarding the resulting 16bit integeras the Unicode michael@0: encoding of a character. If no arguments are supplied, michael@0: the result is the empty string. michael@0: michael@0: This tests String.fromCharCode with multiple arguments. michael@0: michael@0: Author: christine@netscape.com michael@0: Date: 2 october 1997 michael@0: */ michael@0: michael@0: var SECTION = "15.5.3.2-2"; michael@0: var VERSION = "ECMA_1"; michael@0: startTest(); michael@0: var TITLE = "String.fromCharCode()"; michael@0: michael@0: writeHeaderToLog( SECTION + " "+ TITLE); michael@0: michael@0: new TestCase( SECTION, michael@0: "var MYSTRING = String.fromCharCode(eval(\"var args=''; for ( i = 0x0020; i < 0x007f; i++ ) { args += ( i == 0x007e ) ? i : i + ', '; } args;\")); MYSTRING", michael@0: " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", michael@0: eval( "var MYSTRING = String.fromCharCode(" + eval("var args=''; for ( i = 0x0020; i < 0x007f; i++ ) { args += ( i == 0x007e ) ? i : i + ', '; } args;") +"); MYSTRING" )); michael@0: michael@0: new TestCase( SECTION, michael@0: "MYSTRING.length", michael@0: 0x007f - 0x0020, michael@0: MYSTRING.length ); michael@0: michael@0: test();