Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/annexB/language/comments/single-line-html-close-asi.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: >
6 A SingleLineHTMLCloseComment is considered to be a LineTerminator for
7 purposes of parsing by the syntactic grammar.
8 info: |
9 Comment ::
10 MultiLineComment
11 SingleLineComment
12 SingleLineHTMLOpenComment
13 SingleLineHTMLCloseComment
14 SingleLineDelimitedComment
15
16 MultiLineComment ::
17 /* FirstCommentLine[opt] LineTerminator MultiLineCommentChars[opt] * / HTMLCloseComment[opt]
18
19 HTMLCloseComment ::
20 WhiteSpaceSequence[opt] SingleLineDelimitedCommentSequence[opt] --> SingleLineCommentChars[opt]
21 negative:
22 phase: runtime
23 type: Test262Error
24 ---*/
25
26 var foo = [23]
27 -->[0];
28
29 // Because this test concerns the interpretation of non-executable character
30 // sequences within ECMAScript source code, special care must be taken to
31 // ensure that executable code is evaluated as expected.
32 //
33 // Express the intended behavior by intentionally throwing an error; this
34 // guarantees that test runners will only consider the test "passing" if
35 // executable sequences are correctly interpreted as such.
36 if (foo[0] === 23) {
37 throw new Test262Error();
38 }