forked from OSchip/llvm-project
clang-format: [JS] Support exporting abstract classes.
Before: export abstract class X {y: number;} (and all sorts of other havoc in more complicated cases). After: export abstract class X { y: number; } llvm-svn: 257451
This commit is contained in:
parent
db147eb5ac
commit
8620d4c55b
|
@ -1809,6 +1809,10 @@ void UnwrappedLineParser::parseJavaScriptEs6ImportExport() {
|
|||
return;
|
||||
}
|
||||
|
||||
// Consume the "abstract" in "export abstract class".
|
||||
if (FormatTok->is(Keywords.kw_abstract))
|
||||
nextToken();
|
||||
|
||||
if (FormatTok->isOneOf(tok::kw_const, tok::kw_class, tok::kw_enum,
|
||||
Keywords.kw_interface, Keywords.kw_let,
|
||||
Keywords.kw_var))
|
||||
|
|
|
@ -878,6 +878,7 @@ TEST_F(FormatTestJS, Modules) {
|
|||
" y: string;\n"
|
||||
"}");
|
||||
verifyFormat("export class X { y: number; }");
|
||||
verifyFormat("export abstract class X { y: number; }");
|
||||
verifyFormat("export default class X { y: number }");
|
||||
verifyFormat("export default function() {\n return 1;\n}");
|
||||
verifyFormat("export var x = 12;");
|
||||
|
|
Loading…
Reference in New Issue