Support printing import("a") (#458)

master
Henry Zhu 2017-01-25 10:33:48 -05:00 committed by Christopher Chedeau
parent f8f0b340e0
commit 6e68f7495f
4 changed files with 15 additions and 0 deletions

View File

@ -458,6 +458,10 @@ function genericPrintNoParens(path, options, print) {
parts.push(path.call(print, "source"), ";");
return concat(parts);
case "Import": {
return "import";
}
case "BlockStatement": {
var naked = path.call(
function(bodyPath) {

View File

@ -0,0 +1,8 @@
exports[`test test.js 1`] = `
"import(\"module.js\");
import(\"module.js\").then((a) => a);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import(\"module.js\");
import(\"module.js\").then(a => a);
"
`;

View File

@ -0,0 +1 @@
run_spec(__dirname, {parser: 'babylon'});

View File

@ -0,0 +1,2 @@
import("module.js");
import("module.js").then((a) => a);