removing self=this assignment

This commit is contained in:
Simon
2017-09-08 17:51:02 +02:00
parent 25ef2610aa
commit 2650c3b3e6
2 changed files with 8 additions and 12 deletions

View File

@@ -186,23 +186,21 @@ module.exports = class DateHistogram extends BaseDataview {
}
sql (psql, override, callback) {
let self = this;
if (!callback) {
callback = override;
override = {};
}
if (this._columnType === null) {
this.getColumnType(psql, this.column, this.queries.no_filters, function (err, type) {
this.getColumnType(psql, this.column, this.queries.no_filters, (err, type) => {
// assume numeric, will fail later
self._columnType = 'numeric';
this._columnType = 'numeric';
if (!err && !!type) {
self._columnType = Object.keys(type).find(function (key) {
this._columnType = Object.keys(type).find(function (key) {
return type[key];
});
}
self.sql(psql, override, callback);
this.sql(psql, override, callback);
}, true); // use read-only transaction
return null;
}

View File

@@ -178,23 +178,21 @@ module.exports = class NumericHistogram extends BaseDataview {
}
sql (psql, override, callback) {
let self = this;
if (!callback) {
callback = override;
override = {};
}
if (this._columnType === null) {
this.getColumnType(psql, this.column, this.queries.no_filters, function (err, type) {
this.getColumnType(psql, this.column, this.queries.no_filters, (err, type) => {
// assume numeric, will fail later
self._columnType = 'numeric';
this._columnType = 'numeric';
if (!err && !!type) {
self._columnType = Object.keys(type).find(function (key) {
this._columnType = Object.keys(type).find(function (key) {
return type[key];
});
}
self.sql(psql, override, callback);
this.sql(psql, override, callback);
}, true); // use read-only transaction
return null;
}