single-line-html-open.js (1211B)
1 // |reftest| error:Test262Error 2 // Copyright (C) 2016 the V8 project authors. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 esid: sec-html-like-comments 6 description: SingleLineHTMLOpenComment 7 info: | 8 Comment :: 9 MultiLineComment 10 SingleLineComment 11 SingleLineHTMLOpenComment 12 SingleLineHTMLCloseComment 13 SingleLineDelimitedComment 14 15 SingleLineHTMLOpenComment :: 16 <!--SingleLineCommentCharsopt 17 negative: 18 phase: runtime 19 type: Test262Error 20 ---*/ 21 22 var counter = 0; 23 <!-- 24 counter += 1; 25 26 <!--the comment extends to these characters 27 counter += 1; 28 29 counter += 1;<!--the comment extends to these characters 30 counter += 1; 31 32 var x = 0; 33 x = -1 <!--x; 34 35 // Because this test concerns the interpretation of non-executable character 36 // sequences within ECMAScript source code, special care must be taken to 37 // ensure that executable code is evaluated as expected. 38 // 39 // Express the intended behavior by intentionally throwing an error; this 40 // guarantees that test runners will only consider the test "passing" if 41 // executable sequences are correctly interpreted as such. 42 if (counter === 4 && x === -1) { 43 throw new Test262Error(); 44 }