Debian Codegraph @

rhino/testsrc/tests/ecma/String/15.5.5.1.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.5.1.js';
7
8 /**
9 File Name: 15.5.5.1
10 ECMA Section: String.length
11 Description:
12
13 The number of characters in the String value represented by this String
14 object.
15
16 Once a String object is created, this property is unchanging. It has the
17 attributes { DontEnum, DontDelete, ReadOnly }.
18
19 Author: [email protected]
20 Date: 12 november 1997
21 */
22
23 var SECTION = "15.5.5.1";
24 var VERSION = "ECMA_1";
25 startTest();
26 var TITLE = "String.length";
27
28 writeHeaderToLog( SECTION + " "+ TITLE);
29
30 new TestCase( SECTION,
31 "var s = new String(); s.length",
32 0,
33 eval("var s = new String(); s.length") );
34
35 new TestCase( SECTION,
36 "var s = new String(); s.length = 10; s.length",
37 0,
38 eval("var s = new String(); s.length = 10; s.length") );
39
40 new TestCase( SECTION,
41 "var s = new String(); var props = ''; for ( var p in s ) { props += p; }; props",
42 "",
43 eval("var s = new String(); var props = ''; for ( var p in s ) { props += p; }; props") );
44
45 new TestCase( SECTION,
46 "var s = new String(); delete s.length",
47 false,
48 eval("var s = new String(); delete s.length") );
49
50 new TestCase( SECTION,
51 "var s = new String('hello'); delete s.length; s.length",
52 5,
53 eval("var s = new String('hello'); delete s.length; s.length") );
54
55 test();