Closed radex closed 4 years ago
because of this:
function UniqueIndex(uniqueField) { this.keyMap = {}; }; /* snip */ UniqueIndex.prototype.get = function (key) { return this.keyMap[key]; };
collection.by(key, xxx) cannot have any unsanitized xxx input or it might fail. For example, this.keyMap['hasOwnProperty'] will always be truthy.
collection.by(key, xxx)
xxx
this.keyMap['hasOwnProperty']
One simple solution is to use Object.create(null) instead of {}, so that the object has no prototype.
Object.create(null)
{}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
no, bot
because of this:
collection.by(key, xxx)
cannot have any unsanitizedxxx
input or it might fail. For example,this.keyMap['hasOwnProperty']
will always be truthy.One simple solution is to use
Object.create(null)
instead of{}
, so that the object has no prototype.