Skip to content

Commit

Permalink
[javascript mode] Allow TS prefixed | or & operators
Browse files Browse the repository at this point in the history
Closes #5771
  • Loading branch information
marijnh committed Feb 6, 2019
1 parent a0e1c6f commit d101acd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mode/javascript/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
cx.marked = "type"
return cont(afterType)
}
if (value == "|" || value == "&") return cont(typeexpr)
if (type == "string" || type == "number" || type == "atom") return cont(afterType);
if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType)
if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType)
Expand Down

0 comments on commit d101acd

Please sign in to comment.