This commit is contained in:
1 parent
2111f1152c
commit
cea254857a
5 files changed
+133
-20
No files matched your search
@@ -1388,6 +1388,9 @@ function genericPrintNoParens(path, options, print) {
|
||||
if (d.type === "line" && !d.hard) {
|
||||
return d.soft ? "" : " ";
|
||||
}
|
||||
else if(d.type === "if-break") {
|
||||
return d.flatContents || "";
|
||||
}
|
||||
return d;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -26,16 +26,6 @@ exports[`strings.js 1`] = `
|
||||
|
||||
'\\\\uD801\\\\uDC28',
|
||||
];
|
||||
|
||||
foo(\`a long string \${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 } with expr\`);
|
||||
|
||||
const x = \`a long string \${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + ( function() {return 3 })() + 3 + 2 + 3 + 2 + 3 } with expr\`;
|
||||
|
||||
foo(\`a long string \${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + ( function() {
|
||||
const x = 5;
|
||||
|
||||
return x;
|
||||
})() + 3 + 2 + 3 + 2 + 3 } with expr\`);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
[
|
||||
\\"abc\\",
|
||||
@@ -61,17 +51,133 @@ foo(\`a long string \${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + ( functi
|
||||
\\"🐶\\",
|
||||
'\\\\uD801\\\\uDC28'
|
||||
];
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`strings.js 2`] = `
|
||||
"[
|
||||
\\"abc\\",
|
||||
'abc',
|
||||
|
||||
'\\\\'',
|
||||
|
||||
'\\"',
|
||||
'\\\\\\"',
|
||||
'\\\\\\\\\\"',
|
||||
|
||||
\\"'\\",
|
||||
\\"\\\\'\\",
|
||||
\\"\\\\\\\\'\\",
|
||||
|
||||
\\"'\\\\\\"\\",
|
||||
'\\\\'\\"',
|
||||
|
||||
'\\\\\\\\',
|
||||
\\"\\\\\\\\\\",
|
||||
|
||||
'\\\\0',
|
||||
'🐶',
|
||||
|
||||
'\\\\uD801\\\\uDC28',
|
||||
];
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
[
|
||||
\\"abc\\",
|
||||
\\"abc\\",
|
||||
|
||||
\\"'\\",
|
||||
|
||||
'\\"',
|
||||
'\\"',
|
||||
'\\\\\\\\\\"',
|
||||
|
||||
\\"'\\",
|
||||
\\"'\\",
|
||||
\\"\\\\\\\\'\\",
|
||||
|
||||
\\"'\\\\\\"\\",
|
||||
\\"'\\\\\\"\\",
|
||||
|
||||
\\"\\\\\\\\\\",
|
||||
\\"\\\\\\\\\\",
|
||||
|
||||
\\"\\\\0\\",
|
||||
\\"🐶\\",
|
||||
'\\\\uD801\\\\uDC28',
|
||||
];
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`template-literals.js 1`] = `
|
||||
"foo(\`a long string \${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 } with expr\`);
|
||||
|
||||
const x = \`a long string \${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + ( function() {return 3 })() + 3 + 2 + 3 + 2 + 3 } with expr\`;
|
||||
|
||||
foo(\`a long string \${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + ( function() {
|
||||
const x = 5;
|
||||
|
||||
return x;
|
||||
})() + 3 + 2 + 3 + 2 + 3 } with expr\`);
|
||||
|
||||
pipe.write(
|
||||
\`\\\\n \${chalk.dim(\`\\\\u203A and \${more} more \${more} more \${more} more \${more}\`)}\`,
|
||||
);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
foo(
|
||||
\`a long string \${1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3} with expr\`
|
||||
);
|
||||
|
||||
const x = \`a long string \${1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + (function() {
|
||||
return 3;
|
||||
})() + 3 + 2 + 3 + 2 + 3} with expr\`;
|
||||
|
||||
foo(
|
||||
\`a long string \${1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + (function() {
|
||||
const x = 5;
|
||||
|
||||
return x;
|
||||
})() + 3 + 2 + 3 + 2 + 3} with expr\`
|
||||
);
|
||||
|
||||
pipe.write(
|
||||
\`\\\\n \${chalk.dim(\`\\\\u203A and \${more} more \${more} more \${more} more \${more}\`)}\`
|
||||
);
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`template-literals.js 2`] = `
|
||||
"foo(\`a long string \${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 } with expr\`);
|
||||
|
||||
const x = \`a long string \${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + ( function() {return 3 })() + 3 + 2 + 3 + 2 + 3 } with expr\`;
|
||||
|
||||
foo(\`a long string \${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + ( function() {
|
||||
const x = 5;
|
||||
|
||||
return x;
|
||||
})() + 3 + 2 + 3 + 2 + 3 } with expr\`);
|
||||
|
||||
pipe.write(
|
||||
\`\\\\n \${chalk.dim(\`\\\\u203A and \${more} more \${more} more \${more} more \${more}\`)}\`,
|
||||
);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
foo(
|
||||
\`a long string \${1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3} with expr\`,
|
||||
);
|
||||
|
||||
const x = \`a long string \${1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + (function() {
|
||||
return 3;
|
||||
})() + 3 + 2 + 3 + 2 + 3} with expr\`;
|
||||
|
||||
foo(
|
||||
\`a long string \${1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + (function() {
|
||||
const x = 5;
|
||||
|
||||
return x;
|
||||
})() + 3 + 2 + 3 + 2 + 3} with expr\`,
|
||||
);
|
||||
|
||||
pipe.write(
|
||||
\`\\\\n \${chalk.dim(\`\\\\u203A and \${more} more \${more} more \${more} more \${more}\`)}\`,
|
||||
);
|
||||
"
|
||||
`;
|
||||
@@ -1 +1,2 @@
|
||||
run_spec(__dirname);
|
||||
run_spec(__dirname, { trailingComma: "all" });
|
||||
@@ -23,13 +23,3 @@
|
||||
|
||||
'\uD801\uDC28',
|
||||
];
|
||||
|
||||
foo(`a long string ${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 } with expr`);
|
||||
|
||||
const x = `a long string ${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + ( function() {return 3 })() + 3 + 2 + 3 + 2 + 3 } with expr`;
|
||||
|
||||
foo(`a long string ${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + ( function() {
|
||||
const x = 5;
|
||||
|
||||
return x;
|
||||
})() + 3 + 2 + 3 + 2 + 3 } with expr`);
|
||||
@@ -0,0 +1,13 @@
|
||||
foo(`a long string ${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 } with expr`);
|
||||
|
||||
const x = `a long string ${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + ( function() {return 3 })() + 3 + 2 + 3 + 2 + 3 } with expr`;
|
||||
|
||||
foo(`a long string ${ 1 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + 3 + 2 + ( function() {
|
||||
const x = 5;
|
||||
|
||||
return x;
|
||||
})() + 3 + 2 + 3 + 2 + 3 } with expr`);
|
||||
|
||||
pipe.write(
|
||||
`\n ${chalk.dim(`\u203A and ${more} more ${more} more ${more} more ${more}`)}`,
|
||||
);
|
||||
Reference in new issue
Block a user