@microsoft.azure/autorest.incubator
Version:
AutoRest incubator project
25 lines • 882 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const text_manipulation_1 = require("../../../common/text-manipulation");
const statement_1 = require("../../../csharp/code-dom/statements/statement");
function Catch(parameter, body, objectInitializer) {
return new CatchStatement(parameter, body, objectInitializer);
}
exports.Catch = Catch;
class CatchStatement extends statement_1.Statements {
constructor(parameter, body, objectInitializer) {
super(body);
this.parameter = parameter;
this.apply(objectInitializer);
}
get implementation() {
const when = this.when ? ` when (${this.when})` : ``;
return `
catch(${this.parameter.declaration})${when}
{
${text_manipulation_1.indent(super.implementation)}
} `.trim();
}
}
exports.CatchStatement = CatchStatement;
//# sourceMappingURL=catch.js.map