S7.8.4_A4.1_T2.js (853B)
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: "CharacterEscapeSequnce :: SingleEscapeSequence" 6 es5id: 7.8.4_A4.1_T2 7 description: "SingleEscapeSequence :: one of ' \" \\" 8 ---*/ 9 10 //CHECK#1 11 if (String.fromCharCode(0x0027) !== "\'") { 12 throw new Test262Error('#1: String.fromCharCode(0x0027) === "\\\'"'); 13 } 14 15 //CHECK#2 16 if (String.fromCharCode(0x0022) !== '\"') { 17 throw new Test262Error('#2: String.fromCharCode(0x0027) === \'\\\"\''); 18 } 19 20 //CHECK#3 21 if (String.fromCharCode(0x005C) !== "\\") { 22 throw new Test262Error('#3: String.fromCharCode(0x005C) === "\\\"'); 23 } 24 25 //CHECK#4 26 if ("\'" !== "'") { 27 throw new Test262Error('#4: "\'" === "\\\'"'); 28 } 29 30 //CHECK#5 31 if ('\"' !== '"') { 32 throw new Test262Error('#5: \'\"\' === \'\\\"\''); 33 } 34 35 reportCompare(0, 0);