Socket
Socket
Sign inDemoInstall

babel-plugin-fuck-optimization

Package Overview
Dependencies
0
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-fuck-optimization

Plugin for Babel which fucks all the optimizations in your code


Version published
Maintainers
2
Install size
4.89 kB
Created

Readme

Source

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.

FAQs

Last updated on 11 May 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc