Skip to content

Commit 1cefd59

Browse files
committed
[javascript mode] Also fix computed property TS syntax for type exprs and classes
Issue codemirror#5909
1 parent 62ef276 commit 1cefd59

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

mode/javascript/javascript.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
621621
} else if (type == ":") {
622622
return cont(typeexpr)
623623
} else if (type == "[") {
624-
return cont(expect("variable"), maybetype, expect("]"), typeprop)
624+
return cont(expect("variable"), maybetypeOrIn, expect("]"), typeprop)
625625
} else if (type == "(") {
626626
return pass(functiondecl, typeprop)
627627
}
@@ -754,7 +754,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
754754
}
755755
if (type == "number" || type == "string") return cont(isTS ? classfield : functiondef, classBody);
756756
if (type == "[")
757-
return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody)
757+
return cont(expression, maybetypeOrIn, expect("]"), isTS ? classfield : functiondef, classBody)
758758
if (value == "*") {
759759
cx.marked = "keyword";
760760
return cont(classBody);

0 commit comments

Comments
 (0)