GithubHelp home page GithubHelp logo

motiz88 / babel-plugin-transform-hoist-nested-functions Goto Github PK

View Code? Open in Web Editor NEW
32.0 32.0 2.0 98 KB

Babel plugin to move nested functions to outer scopes

License: MIT License

JavaScript 100.00%
babel-plugin

babel-plugin-transform-hoist-nested-functions's People

Contributors

greenkeeper[bot] avatar greenkeeperio-bot avatar motiz88 avatar supreetpal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

thorjarhun

babel-plugin-transform-hoist-nested-functions's Issues

`this` condition for arrow function hoisting is too conservative

Currently, a ThisExpression anywhere inside an arrow function will block it from being hoisted, even if it is not the same this as the one the arrow function closes over:

() => function B () {return this;} // should not block hoisting of the arrow function

Hoist arrow functions in methods to class scope

In:

class A {
  handle(data) {
    //...
  }
  method () {
    return trampoline(data => this.handle(data));
  }
}

Out:

class A {
  handle(data) {
    //...
  }
  _hoistedAnonymousFunction = data => this.handle(data);
  method () {
    return trampoline(this._hoistedAnonymousFunction);
  }
}

An in-range update of eslint-plugin-standard is breaking the build 🚨

Version 2.2.0 of eslint-plugin-standard just got published.

Branch Build failing 🚨
Dependency eslint-plugin-standard
Current Version 2.1.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint-plugin-standard is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ ci/circleci Your tests failed on CircleCI Details
Commits

The new version differs by 3 commits .

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Broken hoisted variable

I get an error that result is not defined.

class Storage {
	// lru calls this callback synchronously
	public get(key: string): Value | null {
		let result: Value
		lru.getItem(this.makeKey(key), this.getOptions, (err, value) => {
			result = value
		})
		return result
	}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.