In arr.forEach(function(arg1) { return arg1; }), arg1 is not scoped as variable.parameter.function.js, whereas in arr.forEach(function (arg1) { return arg1; }) (note space between function and opening paren) it is highlighted appropriately. Other types of functions work fine:
The problem is on line 260 of JavaScript.tmLanguage:
This is an issue in both ST2 and ST3. Take the following code:
In
arr.forEach(function(arg1) { return arg1; })
,arg1
is not scoped asvariable.parameter.function.js
, whereas inarr.forEach(function (arg1) { return arg1; })
(note space betweenfunction
and opening paren) it is highlighted appropriately. Other types of functions work fine:The problem is on line 260 of
JavaScript.tmLanguage
:\s+
is matching one or more whitespace characters afterfunction
, where it should be zero or more -\s*
. With that one change, everything works fine: