constraintjs
constraintjs copied to clipboard
MapConstraint breaks for options.value containing "length"
MapConstraint breaks when created with a value parameter containing "length".
The reason is that it uses the each
function to create the options.keys
and options.values
arrays from options.value
, but each
treats any object containing a "length" property as an array.
As a result option.keys
ends up with integers ranging from 0 to options.value["length"]
and option.values
is filled up of undefined
.