handlebars: fix definition creation (floating ClassCastException in spacebars)
(cherry picked from commit 3e272b1 r=D.Ushakov)