mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix the spacebars compiler crash on unterminated string literal
Fixes #4529
This commit is contained in:
@@ -71,4 +71,8 @@ Tinytest.add("blaze-tools - token parsers", function (test) {
|
||||
runValue(parseStringLiteral, "'\\\\'", '\\');
|
||||
runValue(parseStringLiteral, "'\\\"'", '\"');
|
||||
runValue(parseStringLiteral, "'\\\''", '\'');
|
||||
|
||||
test.throws(function () {
|
||||
run(parseStringLiteral, "'this is my string");
|
||||
}, /Unterminated string literal/);
|
||||
});
|
||||
|
||||
@@ -183,7 +183,7 @@ BlazeTools.parseStringLiteral = function (scanner) {
|
||||
}
|
||||
}
|
||||
|
||||
if (match[0] !== quote)
|
||||
if (! match || match[0] !== quote)
|
||||
scanner.fatal("Unterminated string literal");
|
||||
|
||||
jsonLiteral += '"';
|
||||
|
||||
Reference in New Issue
Block a user