File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,12 @@ pub fn ensure_no_specific_syntax_errors(parsed_source: &ParsedSource) -> Result<
124
124
SyntaxError :: ExpectedDigit { .. } |
125
125
SyntaxError :: ExpectedSemiForExprStmt { .. } |
126
126
SyntaxError :: ExpectedUnicodeEscape |
127
+ // various unterminated
128
+ SyntaxError :: UnterminatedStrLit |
129
+ SyntaxError :: UnterminatedBlockComment |
130
+ SyntaxError :: UnterminatedJSXContents |
131
+ SyntaxError :: UnterminatedRegExp |
132
+ SyntaxError :: UnterminatedTpl |
127
133
// unexpected token
128
134
SyntaxError :: Unexpected { .. } |
129
135
// Merge conflict marker
@@ -293,6 +299,19 @@ mod tests {
293
299
) ;
294
300
}
295
301
302
+ #[ test]
303
+ fn it_should_error_for_exected_string_literal ( ) {
304
+ run_non_fatal_diagnostic_test (
305
+ "./test.ts" ,
306
+ "var foo = 'test" ,
307
+ concat ! (
308
+ "Unterminated string constant at file:///test.ts:1:11\n \n " ,
309
+ " var foo = 'test\n " ,
310
+ " ~~~~~"
311
+ ) ,
312
+ ) ;
313
+ }
314
+
296
315
#[ test]
297
316
fn it_should_error_for_merge_conflict_marker ( ) {
298
317
run_non_fatal_diagnostic_test (
You can’t perform that action at this time.
0 commit comments