Debian Codegraph @

rhino/testsrc/tests/js1_4/Regress/function-003.js

raw symbols SCIP
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 gTestfile = 'function-003.js';
7
8 /**
9 * File Name: function-003.js
10 * Description:
11 *
12 * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=104766
13 *
14 * Author: [email protected]
15 * Date: 11 August 1998
16 */
17 var SECTION = "toString-001.js";
18 var VERSION = "JS1_4";
19 var TITLE = "Regression test case for 104766";
20 var BUGNUMBER="310514";
21
22 startTest();
23
24 writeHeaderToLog( SECTION + " "+ TITLE);
25
26 new TestCase(
27 SECTION,
28 "StripSpaces(Array.prototype.concat.toString()).substring(0,17)",
29 "functionconcat(){",
30 StripSpaces(Array.prototype.concat.toString()).substring(0,17));
31
32 test();
33
34 function StripSpaces( s ) {
35 for ( var currentChar = 0, strippedString="";
36 currentChar < s.length; currentChar++ )
37 {
38 if (!IsWhiteSpace(s.charAt(currentChar))) {
39 strippedString += s.charAt(currentChar);
40 }
41 }
42 return strippedString;
43 }
44
45 function IsWhiteSpace( string ) {
46 var cc = string.charCodeAt(0);
47 switch (cc) {
48 case (0x0009):
49 case (0x000B):
50 case (0x000C):
51 case (0x0020):
52 case (0x000A):
53 case (0x000D):
54 case ( 59 ): // let's strip out semicolons, too
55 return true;
56 break;
57 default:
58 return false;
59 }
60 }
61