Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/annexB/language/comments/multi-line-html-close.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: Optional HTMLCloseComment following MultiLineComment
6 info: |
7 Comment ::
8 MultiLineComment
9 SingleLineComment
10 SingleLineHTMLOpenComment
11 SingleLineHTMLCloseComment
12 SingleLineDelimitedComment
13
14 MultiLineComment ::
15 /* FirstCommentLine[opt] LineTerminator MultiLineCommentChars[opt] * / HTMLCloseComment[opt]
16
17 HTMLCloseComment ::
18 WhiteSpaceSequence[opt] SingleLineDelimitedCommentSequence[opt] --> SingleLineCommentChars[opt]
19 negative:
20 phase: runtime
21 type: Test262Error
22 ---*/
23
24 var counter = 0;
25 /*
26 */-->
27 counter += 1;
28
29 /*
30 */-->the comment extends to these characters
31 counter += 1;
32
33 /* optional FirstCommentLine
34 */-->the comment extends to these characters
35 counter += 1;
36
37 /*
38 optional
39 MultiLineCommentChars */-->the comment extends to these characters
40 counter += 1;
41
42 /*
43 */ /* optional SingleLineDelimitedCommentSequence */-->the comment extends to these characters
44 counter += 1;
45
46 /*
47 */ /**/ /* second optional SingleLineDelimitedCommentSequence */-->the comment extends to these characters
48 counter += 1;
49
50 // The V8 engine exhibited a bug where HTMLCloseComment was not recognized
51 // within MultiLineComment in cases where MultiLineComment was not the first
52 // token on the line of source text. The following tests demonstrate the same
53 // productions listed above with the addition of such a leading token.
54
55 0/*
56 */-->
57 counter += 1;
58
59 0/*
60 */-->the comment extends to these characters
61 counter += 1;
62
63 0/* optional FirstCommentLine
64 */-->the comment extends to these characters
65 counter += 1;
66
67 0/*
68 optional
69 MultiLineCommentChars */-->the comment extends to these characters
70 counter += 1;
71
72 0/*
73 */ /* optional SingleLineDelimitedCommentSequence */-->the comment extends to these characters
74 counter += 1;
75
76 0/*
77 */ /**/ /* second optional SingleLineDelimitedCommentSequence */-->the comment extends to these characters
78 counter += 1;
79
80 // Because this test concerns the interpretation of non-executable character
81 // sequences within ECMAScript source code, special care must be taken to
82 // ensure that executable code is evaluated as expected.
83 //
84 // Express the intended behavior by intentionally throwing an error; this
85 // guarantees that test runners will only consider the test "passing" if
86 // executable sequences are correctly interpreted as such.
87 if (counter === 12) {
88 throw new Test262Error();
89 }