Debian Codegraph @

rhino/testsrc/tests/ecma/String/15.5.4.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 = '15.5.4.js';
7
8 /**
9 File Name: 15.5.4.js
10 ECMA Section: 15.5.4 Properties of the String prototype object
11
12 Description:
13 Author: [email protected]
14 Date: 28 october 1997
15
16 */
17 var SECTION = "15.5.4";
18 var VERSION = "ECMA_1";
19 startTest();
20 var TITLE = "Properties of the String Prototype objecta";
21
22 writeHeaderToLog( SECTION + " "+ TITLE);
23
24
25 new TestCase( SECTION,
26 "String.prototype.getClass = Object.prototype.toString; String.prototype.getClass()",
27 "[object String]",
28 eval("String.prototype.getClass = Object.prototype.toString; String.prototype.getClass()") );
29
30 delete String.prototype.getClass;
31
32 new TestCase( SECTION,
33 "typeof String.prototype",
34 "object",
35 typeof String.prototype );
36
37 new TestCase( SECTION,
38 "String.prototype.valueOf()",
39 "",
40 String.prototype.valueOf() );
41
42 new TestCase( SECTION,
43 "String.prototype +''",
44 "",
45 String.prototype + '' );
46
47 new TestCase( SECTION,
48 "String.prototype.length",
49 0,
50 String.prototype.length );
51
52 var prop;
53 var value;
54
55 value = '';
56 for (prop in "")
57 {
58 value += prop;
59 }
60 new TestCase( SECTION,
61 'String "" has no enumerable properties',
62 '',
63 value );
64
65 value = '';
66 for (prop in String.prototype)
67 {
68 value += prop;
69 }
70 new TestCase( SECTION,
71 'String.prototype has no enumerable properties',
72 '',
73 value );
74
75 test();