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