diff options
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 4 | ||||
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index d35d8a6053d..7b8f6e65241 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -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)) diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index 5e9a1b533ca..992331cecb4 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -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;"); |