|
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/. */ |
|
5 |
|
6 |
|
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. |
|
19 |
|
20 This tests String.fromCharCode with multiple arguments. |
|
21 |
|
22 Author: christine@netscape.com |
|
23 Date: 2 october 1997 |
|
24 */ |
|
25 |
|
26 var SECTION = "15.5.3.2-2"; |
|
27 var VERSION = "ECMA_1"; |
|
28 startTest(); |
|
29 var TITLE = "String.fromCharCode()"; |
|
30 |
|
31 writeHeaderToLog( SECTION + " "+ TITLE); |
|
32 |
|
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" )); |
|
37 |
|
38 new TestCase( SECTION, |
|
39 "MYSTRING.length", |
|
40 0x007f - 0x0020, |
|
41 MYSTRING.length ); |
|
42 |
|
43 test(); |