babel-plugin-fuck-optimization

2.1.1 • Public • Published

babel-plugin-fuck-optimization

Use this plugin when you want to see beautiful bailouts in your code.

Transforms this:

function add(a, b) {
  return a + b;
}

into this:

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) it pushes the new TryStatement with CatchClause within the BlockStatement (optimized in V8 5.3.1) it adds an object literal declaration with modified __proto__ property.

Readme

Keywords

none

Package Sidebar

Install

npm i babel-plugin-fuck-optimization

Weekly Downloads

1

Version

2.1.1

License

MIT

Last publish

Collaborators

  • bniwredyc
  • ghaiklor