[javascript mode] Properly handle exclamation marks in class fields

This commit is contained in:
Roman Frolov 2021-05-12 17:27:20 +03:00 committed by GitHub
parent 472b458a31
commit c7aeed9d69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -799,6 +799,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (value == "@") return cont(expression, classBody)
}
function classfield(type, value) {
if (value == "!") return cont(classfield)
if (value == "?") return cont(classfield)
if (type == ":") return cont(typeexpr, maybeAssign)
if (value == "=") return cont(expressionNoComma)