diff -r 000000000000 -r 6474c204b198 js/src/tests/test262/ch11/11.2/11.2.1/S11.2.1_A3_T3.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/tests/test262/ch11/11.2/11.2.1/S11.2.1_A3_T3.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,40 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * MemberExpression calls ToObject(MemberExpression) and ToString(Expression). CallExpression calls ToObject(CallExpression) and ToString(Expression) + * + * @path ch11/11.2/11.2.1/S11.2.1_A3_T3.js + * @description Checking String case; + */ + +//CHECK#1 +if ("abc123".charAt(5) !== "3") { + $ERROR('#1: "abc123".charAt(5) === "3". Actual: ' + ("abc123".charAt(5))); +} + +//CHECK#2 +if ("abc123"["charAt"](0) !== "a") { + $ERROR('#2: "abc123"["charAt"](0) === "a". Actual: ' + ("abc123"["charAt"](0))); +} + +//CHECK#3 +if ("abc123".length !== 6) { + $ERROR('#3: "abc123".length === 6. Actual: ' + ("abc123".length)); +} + +//CHECK#4 +if ("abc123"["length"] !== 6) { + $ERROR('#4: "abc123"["length"] === 6. Actual: ' + ("abc123"["length"])); +} + +//CHECK#5 +if (new String("abc123").length !== 6) { + $ERROR('#5: new String("abc123").length === 6. Actual: ' + (new String("abc123").length)); +} + +//CHECK#6 +if (new String("abc123")["charAt"](2) !== "c") { + $ERROR('#6: new String("abc123")["charAt"](2) === "c". Actual: ' + (new String("abc123")["charAt"](2))); +} +