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