memcached icon indicating copy to clipboard operation
memcached copied to clipboard

getMulti always fails key validation when used with MooTools

Open thim22 opened this issue 11 years ago • 1 comments

a/node_modules/memcached/lib/utils.js:33

uses a for...in loop to iterate through array values. Apparently MooTools extends Array to include additional properties which fail the no whitespace or newline in key validation.

Suggest using forEach as the iterator and/or checking each property with hasOwnProperty method before attempting to validate it.

thim22 avatar May 19 '14 17:05 thim22

You're using mootools in Node? That's a thing?

Anyway, line 33 here is iterating over an array. It should simply not use var in, but use a simple for-loop with a numerical iterator. It will execute faster that way too. Everybody wins.

ronkorving avatar May 20 '14 00:05 ronkorving