diff --git a/lib/sass/constant.rb b/lib/sass/constant.rb index 88fa5650..b9984b73 100644 --- a/lib/sass/constant.rb +++ b/lib/sass/constant.rb @@ -102,6 +102,9 @@ module Sass str << byte.chr end + if is_string + raise Sass::SyntaxError.new("Unterminated string: #{value.dump}") + end str = reset_str.call to_return end diff --git a/test/sass/engine_test.rb b/test/sass/engine_test.rb index f512fb20..430e2072 100644 --- a/test/sass/engine_test.rb +++ b/test/sass/engine_test.rb @@ -9,6 +9,7 @@ class SassEngineTest < Test::Unit::TestCase "!a = 1 + " => 'Constant arithmetic error: "1 +"', "!a = 1 + 2 +" => 'Constant arithmetic error: "1 + 2 +"', "!a = hello \"world\"" => 'Constant arithmetic error: "hello \\"world\\""', + "!a = \"b" => 'Unterminated string: "\\"b"', "!a = #aaa - a" => 'Undefined operation: "#afafaf minus a"', "!a = #aaa / a" => 'Undefined operation: "#afafaf div a"', "!a = #aaa * a" => 'Undefined operation: "#afafaf times a"',