Only realised this is the source of ruby-haml-js. I submitted a patch to fix the rawjs implementation and treat JavaScript blocks as per haml specification and to work as expected.
see.
dnagir/ruby-haml-js#17
Will gladly re-roll for your project as well if you'd like.