tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

S11.2.1_A3_T3.js (1289B)


      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    MemberExpression calls ToObject(MemberExpression) and
      7    ToString(Expression). CallExpression calls ToObject(CallExpression) and
      8    ToString(Expression)
      9 es5id: 11.2.1_A3_T3
     10 description: Checking String case;
     11 ---*/
     12 
     13 //CHECK#1
     14 if ("abc123".charAt(5) !== "3") {
     15  throw new Test262Error('#1: "abc123".charAt(5) === "3". Actual: ' + ("abc123".charAt(5)));
     16 }
     17 
     18 //CHECK#2
     19 if ("abc123"["charAt"](0) !== "a") {
     20  throw new Test262Error('#2: "abc123"["charAt"](0) === "a". Actual: ' + ("abc123"["charAt"](0)));
     21 }
     22 
     23 //CHECK#3
     24 if ("abc123".length !== 6) {
     25  throw new Test262Error('#3: "abc123".length === 6. Actual: ' + ("abc123".length));
     26 }
     27 
     28 //CHECK#4
     29 if ("abc123"["length"] !== 6) {
     30  throw new Test262Error('#4: "abc123"["length"] === 6. Actual: ' + ("abc123"["length"]));
     31 }
     32 
     33 //CHECK#5
     34 if (new String("abc123").length !== 6) {
     35  throw new Test262Error('#5: new String("abc123").length === 6. Actual: ' + (new String("abc123").length));
     36 }
     37 
     38 //CHECK#6
     39 if (new String("abc123")["charAt"](2) !== "c") {
     40  throw new Test262Error('#6: new String("abc123")["charAt"](2) === "c". Actual: ' + (new String("abc123")["charAt"](2)));
     41 }
     42 
     43 reportCompare(0, 0);