@putout/printer
Advanced tools
Comparing version 8.47.0 to 8.48.0
@@ -11,2 +11,5 @@ 'use strict'; | ||
if (type === 'SequenceExpression') | ||
return print.space(); | ||
if (type === 'StringLiteral' || type === 'TemplateLiteral') | ||
@@ -13,0 +16,0 @@ return print.space(); |
'use strict'; | ||
const {isNext} = require('../../is'); | ||
const {isNext, isParentLast} = require('../../is'); | ||
@@ -9,3 +9,4 @@ module.exports.TryStatement = { | ||
print.indent(); | ||
print('try '); | ||
print('try'); | ||
print.space(); | ||
print('__block'); | ||
@@ -15,5 +16,5 @@ print('__handler'); | ||
if (finalizer.node) { | ||
print(' '); | ||
print.space(); | ||
print('finally'); | ||
print(' '); | ||
print.space(); | ||
print(finalizer); | ||
@@ -30,8 +31,9 @@ print.newline(); | ||
module.exports.CatchClause = (path, {print}) => { | ||
module.exports.CatchClause = (path, {print, maybe}) => { | ||
const param = path.get('param'); | ||
const body = path.get('body'); | ||
print(' '); | ||
print('catch '); | ||
print.space(); | ||
print('catch'); | ||
print.space(); | ||
@@ -41,6 +43,12 @@ if (param.node) { | ||
print(param); | ||
print(') '); | ||
print(')'); | ||
print.space(); | ||
} | ||
print(body); | ||
maybe.print.newline(isInsideBlock(path)); | ||
}; | ||
function isInsideBlock(path) { | ||
return path.parentPath.parentPath.isBlockStatement(); | ||
} |
{ | ||
"name": "@putout/printer", | ||
"version": "8.47.0", | ||
"version": "8.48.0", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
223641
4935
18
25
8
112