class ActionView::Base

def compile_haml(template, file_name, local_assigns)

def compile_haml(template, file_name, local_assigns)
  render_symbol = assign_method_name(:haml, template, file_name)
  locals = local_assigns.keys
  @@template_args[render_symbol] ||= {}
  locals_keys = @@template_args[render_symbol].keys | locals
  @@template_args[render_symbol] = Haml::Util.to_hash(locals_keys.map {|k| [k, true]})
  options = Haml::Template.options.dup
  options[:filename] = file_name || 'compiled-template'
  begin
    Haml::Engine.new(template, options).def_method(CompiledTemplates, render_symbol, *locals_keys)
  rescue Exception => e
    if logger
      logger.debug "ERROR: compiling #{render_symbol} RAISED #{e}"
      logger.debug "Backtrace: #{e.backtrace.join("\n")}"
    end
    base_path = if defined?(extract_base_path_from)
                  # Rails 2.0.x
                  extract_base_path_from(file_name) || view_paths.first
                else
                  # Rails <=1.2.6
                  @base_path
                end
    raise ActionView::TemplateError.new(base_path, file_name || template, @assigns, template, e)
  end
  @@compile_time[render_symbol] = Time.now
end