Comments (4)
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.
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.
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.
Ah, I see there is scope.functionExpressionScope marker there to know when to go one step further.
from escope.
Related Issues (20)
- Function Expression
- Error on ImportDeclaration HOT 1
- Update scope manager scopes once it was created HOT 2
- Add support for label scoping
- New escope-demo (not a bug)
- Add node.body check before attempting to vist children HOT 8
- Variables from global scope have empty references array
- Drop `es6-map`. HOT 1
- Function scope arguments variable HOT 1
- Drop using require'd assert in favour of just throwing an error
- Enter the version directly in index.js
- Problem with unused library functions
- let declaration treated as var declaration HOT 1
- Function declarations attached to block scope? HOT 1
- Another version of escope HOT 1
- what does 'through' in escope mean? HOT 1
- Maybe i find a bug in escope ?
- Is ES6 parameter scope not supported? HOT 1
- JSDoc unavailable: 404 error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from escope.