diff --git a/mode/javascript/javascript.js b/mode/javascript/javascript.js index 793d2fa580..fd0fce44c4 100644 --- a/mode/javascript/javascript.js +++ b/mode/javascript/javascript.js @@ -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)