不要怂,就是干,撸起袖子干!

Commit aa099574 by Jan Aagaard Meier

Merge pull request #5221 from sequelize/greenkeeper-jshint-2.9.1

jshint@2.9.1 breaks build 
2 parents 8760076b 731ccd00
......@@ -109,17 +109,6 @@ var groupJoinData = function(rows, includeOptions, options) {
includeMap[previousPiece] = $current;
}
}
// Calcuate the last item in the array prefix ('Results' for 'User.Results.id')
, lastKeyPrefixMemo = {}
, lastKeyPrefix = function (key) {
if (!lastKeyPrefixMemo[key]) {
var prefix = keyPrefix(key)
, length = prefix.length;
lastKeyPrefixMemo[key] = !length ? '' : prefix[length - 1];
}
return lastKeyPrefixMemo[key];
}
// Calculate the string prefix of a key ('User.Results' for 'User.Results.id')
, keyPrefixStringMemo = {}
, keyPrefixString = function (key, memo) {
......@@ -150,6 +139,17 @@ var groupJoinData = function(rows, includeOptions, options) {
}
return keyPrefixMemo[key];
}
// Calcuate the last item in the array prefix ('Results' for 'User.Results.id')
, lastKeyPrefixMemo = {}
, lastKeyPrefix = function (key) {
if (!lastKeyPrefixMemo[key]) {
var prefix = keyPrefix(key)
, length = prefix.length;
lastKeyPrefixMemo[key] = !length ? '' : prefix[length - 1];
}
return lastKeyPrefixMemo[key];
}
, getUniqueKeyAttributes = function (model) {
var uniqueKeyAttributes = Utils._.chain(model.uniqueKeys);
uniqueKeyAttributes = uniqueKeyAttributes
......
......@@ -213,9 +213,11 @@ QueryInterface.prototype.dropTable = function(tableName, options) {
};
QueryInterface.prototype.dropAllTables = function(options) {
var self = this;
var self = this
, skip;
options = options || {};
skip = options.skip || [];
var dropAllTables = function(tableNames) {
return Promise.each(tableNames, function(tableName) {
......@@ -226,7 +228,6 @@ QueryInterface.prototype.dropAllTables = function(options) {
});
};
var skip = options.skip || [];
return self.showAllTables(options).then(function(tableNames) {
if (self.sequelize.options.dialect === 'sqlite') {
return self.sequelize.query('PRAGMA foreign_keys;', options).then(function(result) {
......
......@@ -61,7 +61,7 @@
"git": "^0.1.5",
"hints": "^0.2.0",
"istanbul": "^0.4.0",
"jshint": "^2.8.0",
"jshint": "^2.9.1",
"lcov-result-merger": "^1.0.0",
"mocha": "^2.2.1",
"mysql": "~2.10.0",
......
......@@ -90,14 +90,14 @@ describe(Support.getTestDialectTeaser('Transaction'), function() {
field: 'value'
}
})
, self = this
, transTest = function (val) {
return self.sequelize.transaction({isolationLevel: 'SERIALIZABLE'}, function(t) {
return SumSumSum.sum('value', {transaction: t}).then(function (balance) {
return SumSumSum.create({value: -val}, {transaction: t});
});
});
}
, self = this;
};
// Attention: this test is a bit racy. If you find a nicer way to test this: go ahead
return SumSumSum.sync({force: true}).then(function () {
return (expect(Promise.join(transTest(80), transTest(80), transTest(80))).to.eventually.be.rejectedWith('could not serialize access due to read/write dependencies among transactions'));
......@@ -239,7 +239,7 @@ describe(Support.getTestDialectTeaser('Transaction'), function() {
});
});
}
if (current.dialect.supports.transactionOptions.type) {
describe('transaction types', function() {
it('should support default transaction type DEFERRED', function() {
......@@ -250,7 +250,7 @@ describe(Support.getTestDialectTeaser('Transaction'), function() {
});
});
});
Object.keys(Transaction.TYPES).forEach(function(key) {
it('should allow specification of ' + key + ' type', function() {
return this.sequelize.transaction({
......@@ -262,7 +262,7 @@ describe(Support.getTestDialectTeaser('Transaction'), function() {
});
});
});
});
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!