S11.8.3_A4.11.js (1148B)
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: If x is a prefix of y, return true 6 es5id: 11.8.3_A4.11 7 description: x and y are string primitives 8 ---*/ 9 10 //CHECK#1 11 if (("x" <= "x") !== true) { 12 throw new Test262Error('#1: ("x" <= "x") === true'); 13 } 14 15 //CHECK#2 16 if (("" <= "x") !== true) { 17 throw new Test262Error('#2: ("" <= "x") === true'); 18 } 19 20 //CHECK#3 21 if (("ab" <= "abcd") !== true) { 22 throw new Test262Error('#3: ("ab" <= abcd") === true'); 23 } 24 25 //CHECK#4 26 if (("abcd" <= "abc\u0064") !== true) { 27 throw new Test262Error('#4: ("abcd" <= abc\\u0064") === true'); 28 } 29 30 //CHECK#5 31 if (("x" <= "x" + "y") !== true) { 32 throw new Test262Error('#5: ("x" <= "x" + "y") === true'); 33 } 34 35 //CHECK#6 36 var x = "x"; 37 if ((x <= x + "y") !== true) { 38 throw new Test262Error('#6: var x = "x"; (x <= x + "y") === true'); 39 } 40 41 //CHECK#7 42 if (("a\u0000" <= "a\u0000a") !== true) { 43 throw new Test262Error('#7: ("a\\u0000" <= "a\\u0000a") === true'); 44 } 45 46 //CHECK#8 47 if (("x" <= " x") !== false) { 48 throw new Test262Error('#8: ("x" <= " x") === false'); 49 } 50 51 reportCompare(0, 0);