no-undef: 'arguments' is undefined when used inside function parameters destructuring assignment
See original GitHub issue- ESLint Version: 5.2.0
- Node Version: 10.6.0
- npm Version: 6.1.0
Configuration
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "script",
"ecmaFeatures": {}
},
"rules": {
"no-undef": 2
},
"env": {}
}
(function test({url = arguments[0]} = {}) {
return url;
})('foo')
Expected: no errors
Observed: 'arguments' is not defined. (no-undef)
P.S. (function test({url} = {}) { return arguments[0] })()
is ok.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to handle destructuring of function argument with ...
Note:- default parameters will come into picture only when there is no arguments passed or undefined is passed as argument, so if you...
Read more >Destructuring assignment - JavaScript - MDN Web Docs
The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from ...
Read more >Extract Functions Arguments using Destructure in JavaScript
Destructuring is terrific at extracting value from your arguments. So swap out those bracket ... Parameter: is the variable in the function declaration....
Read more >Rules - JavaScript Standard Style
Use single quotes for strings except to avoid escaping. ... Always handle the err function parameter. ... Add spaces inside single line blocks....
Read more >Disallow Use of undefined Variable (no-undefined) - ESLint
While ECMAScript 5 disallows overwriting undefined , it's still possible to shadow undefined , such as: function doSomething(data) { var undefined ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is still a bug, and should be reopened.
Native implementation both in node’s repl and in a browser’s devtools.