Holding armor produces the same effect as wearing it, including enchantments.
To reproduce, give yourself armor, and hold it. You should take as much damage as if you were wearing the armor. If you put depth strider onto armor and hold it, you will move faster in water, even though you aren't wearing the boots.
On an unrelated note, this is the eighty-four-thousandth issue xD
Can confirm.