class Haml::Compiler
def locals_code(names)
def locals_code(names) names = names.keys if Hash == names names.map do |name| # Can't use || because someone might explicitly pass in false with a symbol sym_local = "_haml_locals[#{inspect_obj(name.to_sym)}]" str_local = "_haml_locals[#{inspect_obj(name.to_s)}]" "#{name} = #{sym_local}.nil? ? #{str_local} : #{sym_local}" end.join(';') + ';' end