S11.8.4_A4.11.js (1147B)
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 y is a prefix of x, return true 6 es5id: 11.8.4_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 (("abcd" >= "ab") !== true) { 22 throw new Test262Error('#3: ("abcd" >= ab") === true'); 23 } 24 25 //CHECK#4 26 if (("abc\u0064" >= "abcd") !== true) { 27 throw new Test262Error('#4: ("abc\\u0064" >= abc") === true'); 28 } 29 30 //CHECK#5 31 if (("x" + "y" >= "x") !== true) { 32 throw new Test262Error('#5: ("x" + "y" >= "x") === true'); 33 } 34 35 //CHECK#6 36 var x = "x"; 37 if ((x + 'y' >= x) !== true) { 38 throw new Test262Error('#6: var x = "x"; (x + "y" >= x) === true'); 39 } 40 41 //CHECK#7 42 if (("a\u0000a" >= "a\u0000") !== true) { 43 throw new Test262Error('#7: ("a\\u0000a" >= "a\\u0000") === 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);