The JavaScript syntax has special rules for assigning functions, e.g. foo.bar = function() { … } However the equals operator was not scoped in these cases, whereas it is in standard assigns. Changed: U trunk/Bundles/JavaScript.tmbundle/Syntaxes/JavaScript.plist