From 1959a841fd8823383f5e37e3bf7028a2f71377b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 15 Sep 2017 14:26:22 +0200 Subject: [PATCH] Use arrow function to take advantage of bound context --- lib/cartodb/models/dataview/base.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/cartodb/models/dataview/base.js b/lib/cartodb/models/dataview/base.js index 702f43e5..ea7f9474 100644 --- a/lib/cartodb/models/dataview/base.js +++ b/lib/cartodb/models/dataview/base.js @@ -21,8 +21,7 @@ function getPGTypeName (pgType) { module.exports = class BaseDataview { getResult (psql, override, callback) { - const self = this; - this.sql(psql, override, function(err, query) { + this.sql(psql, override, (err, query) => { if (err) { return callback(err); } @@ -32,8 +31,8 @@ module.exports = class BaseDataview { return callback(err, result); } - result = self.format(result, override); - result.type = self.getType(); + result = this.format(result, override); + result.type = this.getType(); return callback(null, result);