Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return (() => {
throw new Error(
`not supported yet: ${Caf.toString(outputType)}`
);
})();
}
this.prototype.toJs = function(options = {}) {
let returnExpression, body, optionalCatch;
({ returnExpression } = options);
({ body, optionalCatch } = this.labeledChildren);
body = returnExpression ? body.toFunctionBodyJs() : body.toJs();
optionalCatch = Caf.exists(optionalCatch) &&
optionalCatch.toJs(options) ||
"catch (cafError) {}";
return `try {${Caf.toString(body)};} ${Caf.toString(optionalCatch)}`;
};
this.prototype.toJsExpression = function() {
this.prototype.toJs = function(options = {}) {
let expression, body, optionalCatch, js;
({ expression } = options);
({ body, optionalCatch } = this.labeledChildren);
body = expression ? body.toFunctionBodyJs() : body.toJs();
optionalCatch = Caf.exists(optionalCatch) &&
optionalCatch.toJs(options) ||
"catch (cafError) {}";
js = `try {${Caf.toString(body)};} ${Caf.toString(optionalCatch)}`;
return expression ? this.doJs(null, js) : js;
};
}