Debian Codegraph @

js/src/tests/test262/built-ins/String/S15.5.5.1_A1.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: |
6 length property contains the number of characters in the String value
7 represented by this String object
8 es5id: 15.5.5.1_A1
9 description: Create strings and check its length
10 ---*/
11
12 var __str__instance = new String("ABC\u0041\u0042\u0043");
13
14 //////////////////////////////////////////////////////////////////////////////
15 //CHECK#1
16 if (__str__instance.length !== 6) {
17 throw new Test262Error('#1: var __str__instance = new String("ABC\\u0041\\u0042\\u0043"); __str__instance.length === 6, where __str__instance is new String("ABC\\u0041\\u0042\\u0043"). Actual: __str__instance.length ===' + __str__instance.length);
18 }
19 //
20 //////////////////////////////////////////////////////////////////////////////
21
22 __str__instance = new String;
23
24 //////////////////////////////////////////////////////////////////////////////
25 //CHECK#2
26 if (__str__instance.length !== 0) {
27 throw new Test262Error('#2: __str__instance = new String; __str__instance.length === 0, where __str__instance is new String. Actual: __str__instance.length ===' + __str__instance.length);
28 }
29 //
30 //////////////////////////////////////////////////////////////////////////////
31
32 reportCompare(0, 0);