GithubHelp home page GithubHelp logo

Comments (4)

michaelficarra avatar michaelficarra commented on June 13, 2024

Named function expressions create an extra scope object which only contain the function name binding. It should have a child scope which contains all of the bindings in the function body and parameter list.

from escope.

lainverse avatar lainverse commented on June 13, 2024

To be honest such behaviour doesn't makes much sense from my point of view, but if this is what actually happening when it runs then ok. However, why does 'acquire' points to this particular scope? It's rather inconvenient and inconsistent in combination with traverse. It makes more sense to point to actual function's scope. That one would remain available through .upper anyway in case anyone ever needs it.

from escope.

michaelficarra avatar michaelficarra commented on June 13, 2024

I disagree. The nearest scope object to the function expression's AST node is the one containing the function name. I would be okay with associating the inner scope object with the FunctionBody node, if that's not how it's already done today.

from escope.

lainverse avatar lainverse commented on June 13, 2024

Ah, I see there is scope.functionExpressionScope marker there to know when to go one step further.

from escope.

Related Issues (20)

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.