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.
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/. */
7 /**
8 File Name: 15.5.4.js
9 ECMA Section: 15.5.4 Properties of the String prototype object
11 Description:
12 Author: christine@netscape.com
13 Date: 28 october 1997
15 */
16 var SECTION = "15.5.4";
17 var VERSION = "ECMA_1";
18 startTest();
19 var TITLE = "Properties of the String Prototype objecta";
21 writeHeaderToLog( SECTION + " "+ TITLE);
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()") );
29 delete String.prototype.getClass;
31 new TestCase( SECTION,
32 "typeof String.prototype",
33 "object",
34 typeof String.prototype );
36 new TestCase( SECTION,
37 "String.prototype.valueOf()",
38 "",
39 String.prototype.valueOf() );
41 new TestCase( SECTION,
42 "String.prototype +''",
43 "",
44 String.prototype + '' );
46 new TestCase( SECTION,
47 "String.prototype.length",
48 0,
49 String.prototype.length );
51 var prop;
52 var value;
54 value = '';
55 for (prop in "")
56 {
57 value += prop;
58 }
59 new TestCase( SECTION,
60 'String "" has no enumerable properties',
61 '',
62 value );
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 );
74 test();