Plugin for Babel which fucks all the optimizations in your code
npm install babel-plugin-fuck-optimizationUse this plugin when you want to see beautiful bailouts in your code.
Transforms this:
``js`
function add(a, b) {
return a + b;
}
into this:
`js`
function add(a, b) {
var __deoptimization = {
__proto__: "notsofast"
};
return a + b;
}
It traverses all the BlockStatement and if its parent is FunctionDeclaration, ClassMethod, FunctionExpression or ArrowFunctionExpression (basically all functions in your code)TryStatement
~~it pushes the new with CatchClause within the BlockStatement~~ (optimized in V8 5.3.1)__proto__` property.
it adds an object literal declaration with modified