fixes dynamic imports (#2748)

This commit is contained in:
Roman Kurbatov authored and Lucas Azzola committed 2017-09-05 11:57:36 +10:00
1 parent c59a82cbae
commit 01387bc9d1
4 files changed
+30 -1

No files matched your search

+1
View File
@@ -9,3 +9,4 @@ npm-debug.log
/website/node_modules
.DS_Store
coverage
.idea
+3 -1
View File
@@ -30,7 +30,9 @@ function getSortedChildNodes(node, text, resultArray) {
node.type !== "Line" &&
node.type !== "Block" &&
node.type !== "EmptyStatement" &&
node.type !== "TemplateElement") ||
node.type !== "TemplateElement" &&
node.type !== "Import" &&
!(node.callee && node.callee.type === "Import")) ||
(node.kind && node.kind !== "Comment"))
) {
// This reverse insertion sort almost always takes constant
@@ -208,6 +208,25 @@ for (;;);
`;
exports[`dynamic_imports.js 1`] = `
import(/* Hello */ 'something')
import('something' /* Hello */)
import(/* Hello */ 'something' /* Hello */)
import('something' /* Hello */ + 'else')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import(/* Hello */ "something");
import("something" /* Hello */);
import(/* Hello */ "something" /* Hello */);
import("something" /* Hello */ + "else");
`;
exports[`export.js 1`] = `
export //comment
{}
+7
View File
@@ -0,0 +1,7 @@
import(/* Hello */ 'something')
import('something' /* Hello */)
import(/* Hello */ 'something' /* Hello */)
import('something' /* Hello */ + 'else')