Index: pkg/compiler/lib/src/string_validator.dart |
diff --git a/pkg/compiler/lib/src/string_validator.dart b/pkg/compiler/lib/src/string_validator.dart |
index 75f59f54a81352479f999f2239cc5b80834047fb..208353a52f5d666390dfe573a025c2df782a4445 100644 |
--- a/pkg/compiler/lib/src/string_validator.dart |
+++ b/pkg/compiler/lib/src/string_validator.dart |
@@ -25,7 +25,13 @@ class StringValidator { |
int leftQuote = 0; |
int rightQuote = 0; |
if (isFirst) leftQuote = quoting.leftQuoteLength; |
- if (isLast) rightQuote = quoting.rightQuoteLength; |
+ if (isLast) { |
+ // Check for unterminated string |
+ if (leftQuote < source.length && |
+ source[source.length - 1] == quoting.quoteChar) { |
+ rightQuote = quoting.rightQuoteLength; |
ahe
2017/05/29 15:05:30
What happens with this string:
"""x"
|
+ } |
+ } |
String content = copyWithoutQuotes(source, leftQuote, rightQuote); |
return validateString( |
token, token.charOffset + leftQuote, content, quoting); |