Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/annexB/language/comments/single-line-html-open.js

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