clang-format: [JS] no ASI on `import {x as\n y}`.
Summary: ASI did not handle the ES6 `as` operator correctly.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D20817
llvm-svn: 271401
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index be6f960..f646b82 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -1010,6 +1010,9 @@
"} from 'some/module.js';");
verifyFormat("import {X, Y,} from 'some/module.js';");
verifyFormat("import {X as myLocalX, Y as myLocalY} from 'some/module.js';");
+ // Ensure Automatic Semicolon Insertion does not break on "as\n".
+ verifyFormat("import {X as myX} from 'm';", "import {X as\n"
+ " myX} from 'm';");
verifyFormat("import * as lib from 'some/module.js';");
verifyFormat("var x = {import: 1};\nx.import = 2;");