Clean up comments

This commit is contained in:
Raymond Feng 2014-06-20 12:05:32 -07:00
parent b3b29d7313
commit a1836662a7
2 changed files with 6 additions and 4 deletions

View File

@ -368,6 +368,8 @@ function applyFilter(filter) {
return pattern;
}
var regex = '';
// Escaping user input to be treated as a literal string within a regular expression
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Writing_a_Regular_Expression_Pattern
pattern = pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
for (var i = 0, n = pattern.length; i < n; i++) {
var char = pattern.charAt(i);

View File

@ -982,25 +982,25 @@ DataAccessObject.updateAll = function (where, data, cb) {
if (stillConnecting(this.getDataSource(), this, arguments)) return;
if (arguments.length === 1) {
// update(data);
// update(data) is being called
data = where;
where = null;
cb = null;
} else if (arguments.length === 2) {
if (typeof data === 'function') {
// update(data, cb);
// update(data, cb) is being called
cb = data;
data = where;
where = null;
} else {
// update(where, data);
// update(where, data) is being called
cb = null;
}
}
assert(typeof where === 'object', 'The where argument should be an object');
assert(typeof data === 'object', 'The data argument should be an object');
assert(cb === null || typeof cb === 'function', 'The data argument should be an object');
assert(cb === null || typeof cb === 'function', 'The cb argument should be a function');
try {
where = removeUndefined(where);