Comments (5)
Interesting point. The conundrum here is that this behavior matches Esprima's, so even if it's the wrong thing, there's a large compatibly issue to consider.
This definitely seems weird, it's just a matter of figuring out of its a bug to fix or not.
from espree.
Agreed; I wouldn't advocate breaking compatibility unnecessarily. However, I might be able to make the case that this would be a bug in Esprima:
Now that I edited the test script above to output arg1
, it shows a strange scenario in which one can traverse, starting at the FunctionExpression
(range 18-20), down into a child, arg1
(range 12-16), that lies outside the range of its parent. I can't think of any other instance off the top of my head where that would be the case.
from espree.
I think a good case can be made that this is a bug. Would you mind filing an issue with Esprima to start the discussion?
from espree.
Upon further investigation, this applies to non-generator shorthand methods as well.
Esprima issue: https://code.google.com/p/esprima/issues/detail?id=625
from espree.
The Esprima issue has been moved to jquery/esprima#1029.
from espree.
Related Issues (20)
- vague misleading licensing grant in test files with V8 project as copyright holder HOT 1
- needless devDependency on regenerate and unicode-6.3.0 HOT 1
- incorrect escape in string? HOT 7
- Please export `TokenTranslator` for reusing outside for ESLint plugins HOT 4
- Error parsing file starting with '#!/usr/bin/env node' HOT 2
- support import assertions HOT 1
- as token type: Identifier -> Punctuator HOT 3
- How to use from a script tag? HOT 1
- Not able to access parent node from current node. HOT 2
- Set up release-please HOT 1
- Set up scripts/lint-staged to match those in eslint repo HOT 3
- remove sourcemap url HOT 7
- typing for parse() HOT 1
- Support for `using` keyword HOT 1
- # ⚠️ npm 6.x no extra double-dash: npm init @eslint/config --config semistandard HOT 2
- add npm install step to release-please workflow (#573) (d8900c1) run tests on Node.js v20 (#571) (adf478e) set up release-please (#569) (abda10f) upgrade [email protected] (#574) (8e73f11) HOT 1
- Invalid regular expression flag HOT 2
- 9 Failing tests on project install HOT 1
- espree improvements as an acorn plugin extension [RFC] HOT 1
- Is it possible to configure tokenize method to return hyphenated word as one token? HOT 1
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 espree.