Debian Codegraph @

js/src/tests/test262/annexB/language/comments/single-line-html-close-asi.js

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