jshint: fix Function declarations should not be placed in blocks

This commit is contained in:
Raul Ochoa 2015-03-15 23:56:14 +01:00
parent bd1c24ee1c
commit 438ecd5598
2 changed files with 9 additions and 9 deletions

View File

@ -8,7 +8,7 @@
// "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) // "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
// "camelcase" : false, // true: Identifiers must be in camelCase // "camelcase" : false, // true: Identifiers must be in camelCase
// "curly" : true, // true: Require {} for every new block or scope // "curly" : true, // true: Require {} for every new block or scope
"eqeqeq" : true, // true: Require triple equals (===) for comparison // "eqeqeq" : true, // true: Require triple equals (===) for comparison
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty() "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
"freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc. "freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc.
"immed" : true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` "immed" : true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`

View File

@ -54,7 +54,6 @@ var CartodbWindshaft = function(serverOptions) {
varnishHttpCacheBackend = new VarnishHttpCacheBackend(serverOptions.varnish_host, serverOptions.varnish_http_port), varnishHttpCacheBackend = new VarnishHttpCacheBackend(serverOptions.varnish_host, serverOptions.varnish_http_port),
surrogateKeysCache = new SurrogateKeysCache(varnishHttpCacheBackend); surrogateKeysCache = new SurrogateKeysCache(varnishHttpCacheBackend);
if (serverOptions.varnish_purge_enabled) {
function invalidateNamedMap (owner, templateName) { function invalidateNamedMap (owner, templateName) {
surrogateKeysCache.invalidate(new NamedMapsCacheEntry(owner, templateName), function(err) { surrogateKeysCache.invalidate(new NamedMapsCacheEntry(owner, templateName), function(err) {
if (err) { if (err) {
@ -63,6 +62,7 @@ var CartodbWindshaft = function(serverOptions) {
}); });
} }
if (serverOptions.varnish_purge_enabled) {
['update', 'delete'].forEach(function(eventType) { ['update', 'delete'].forEach(function(eventType) {
templateMaps.on(eventType, invalidateNamedMap); templateMaps.on(eventType, invalidateNamedMap);
}); });