summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-10-26 20:10:50 +0000
committerAndreas Kling <kling@serenityos.org>2020-10-26 21:38:34 +0100
commit19edcbd79cce05e9317815b65f0bcd2fc78260f2 (patch)
treee7e42ca7767e275ae329af635ec682d5a6c509bd /Libraries/LibJS/Tests
parent03c1d43f6ecaae72927224622ac54e05e43b3206 (diff)
downloadserenity-19edcbd79cce05e9317815b65f0bcd2fc78260f2.zip
LibJS: Emit TokenType::Invalid for unterminated multi-line comments
Diffstat (limited to 'Libraries/LibJS/Tests')
-rw-r--r--Libraries/LibJS/Tests/comments-basic.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/Libraries/LibJS/Tests/comments-basic.js b/Libraries/LibJS/Tests/comments-basic.js
index 1a7d281087..f013d59f70 100644
--- a/Libraries/LibJS/Tests/comments-basic.js
+++ b/Libraries/LibJS/Tests/comments-basic.js
@@ -21,3 +21,11 @@ return i;`;
expect(source).toEvalTo(1);
});
+
+test("unterminated multi-line comment", () => {
+ expect("/*").not.toEval();
+ expect("/**").not.toEval();
+ expect("/*/").not.toEval();
+ expect("/* foo").not.toEval();
+ expect("foo /*").not.toEval();
+});