mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Make the deprecation warning for implicit strings similar to past warnings.
This commit is contained in:
parent
b0f7432eb5
commit
f098a39d34
2 changed files with 7 additions and 2 deletions
|
@ -68,7 +68,12 @@ RUBY
|
|||
return paren unless name = try_tok(:ident)
|
||||
# An identifier without arguments is just a string
|
||||
unless try_tok(:lparen)
|
||||
warn %Q{WARNING: Implicit strings are deprecated. '#{name.value}' found at line #{name.line}, character #{name.offset}#{" of '#{@filename}'" if @filename} was not quoted. Please add double quotes. E.g. "#{name.value}".}
|
||||
warn(<<END)
|
||||
DEPRECATION WARNING:
|
||||
On line #{name.line}, character #{name.offset}#{" of '#{@filename}'" if @filename}
|
||||
Implicit strings have been deprecated and will be removed in version 2.4.
|
||||
'#{name.value}' was not quoted. Please add double quotes (e.g. "#{name.value}").
|
||||
END
|
||||
Script::String.new(name.value)
|
||||
else
|
||||
args = arglist || []
|
||||
|
|
|
@ -718,7 +718,7 @@ SASS
|
|||
end
|
||||
|
||||
def test_inaccessible_functions
|
||||
assert_warning %Q{WARNING: Implicit strings are deprecated. 'to_s' found at line 2, character 12 of 'test_inaccessible_functions_inline.sass' was not quoted. Please add double quotes. E.g. \"to_s\".} do
|
||||
assert_warning "DEPRECATION WARNING:\nOn line 2, character 12 of 'test_inaccessible_functions_inline.sass'\nImplicit strings have been deprecated and will be removed in version 2.4.\n'to_s' was not quoted. Please add double quotes (e.g. \"to_s\")." do
|
||||
assert_equal("a {\n b: send(to_s); }\n", render("a\n b = send(to_s)"))
|
||||
end
|
||||
assert_equal("a {\n b: public_instance_methods(); }\n", render("a\n b = public_instance_methods()"))
|
||||
|
|
Loading…
Add table
Reference in a new issue