mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Fixing a potential issue with locals.
git-svn-id: svn://hamptoncatlin.com/haml/trunk@594 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
parent
3e35978259
commit
b7cf2063b4
2 changed files with 2 additions and 2 deletions
|
@ -203,7 +203,7 @@ END
|
|||
@@supported_local_assigns[@template] = supported_local_assigns
|
||||
@options[:locals].each do |k,v|
|
||||
supported_local_assigns[k] = true
|
||||
push_silent "#{k} = local_assigns[:#{k}]"
|
||||
push_silent "#{k} = local_assigns[#{k.inspect}]"
|
||||
end
|
||||
|
||||
old_line = nil
|
||||
|
|
|
@ -142,7 +142,7 @@ class EngineTest < Test::Unit::TestCase
|
|||
assert_equal("<p>first time</p>\n", render(template, :locals => { :text => "first time", :foo => 'bar' }))
|
||||
end
|
||||
|
||||
def test_dynamc_attrs_shouldnt_register_as_literal_values
|
||||
def test_dynamic_attrs_shouldnt_register_as_literal_values
|
||||
assert_equal("<p a='b2c'>\n</p>\n", render('%p{:a => "b#{1 + 1}c"}'))
|
||||
assert_equal("<p a='b2c'>\n</p>\n", render("%p{:a => 'b' + (1 + 1).to_s + 'c'}"))
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue