Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make all intance method callback has a context of `this` as instance …

…itself
  • Loading branch information...
commit 7088e7ad3c4cdbe3c8f0c1606ff4699aef9b0034 1 parent d6889e6
@ktmud ktmud authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/model.js
View
6 lib/model.js
@@ -691,7 +691,7 @@ AbstractClass.prototype.save = function (options, callback) {
if (valid) {
return save();
}
- var err = err || new ValidationError(inst);
+ err = err || new ValidationError(inst);
// throws option is dangerous for async usage
if (options.throws) {
throw err;
@@ -710,7 +710,7 @@ AbstractClass.prototype.save = function (options, callback) {
inst._initProperties(data, false);
updateDone.call(inst, function () {
saveDone.call(inst, function () {
- callback(err, inst);
+ callback.call(inst, err, inst);
});
});
});
@@ -876,7 +876,7 @@ AbstractClass.prototype.updateAttributes = function updateAttributes(data, callb
done.call(inst, function () {
saveDone.call(inst, function () {
if (callback) {
- callback(err, inst);
+ callback.call(inst, err, inst);
}
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.