Skip to content

Commit 03051a2

Browse files
committed
[javascript mode] Parse arrow function params as paramaters, not plain patterns
Closes codemirror#4933
1 parent 35a5139 commit 03051a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mode/javascript/javascript.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
398398
function expressionInner(type, noComma) {
399399
if (cx.state.fatArrowAt == cx.stream.start) {
400400
var body = noComma ? arrowBodyNoComma : arrowBody;
401-
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext);
401+
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext);
402402
else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);
403403
}
404404

0 commit comments

Comments
 (0)