[FunctionSearch] name functions based on their var#2404
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2404 +/- ##
======================================
Coverage 0% 0%
======================================
Files 77 77
Lines 2485 2485
======================================
Misses 2485 2485Continue to review full report at Codecov.
|
| if (parent.right && parent.right.type == "FunctionExpression") { | ||
| return parent.left.property.name; | ||
| } | ||
|
|
| "count", | ||
| "counter", | ||
| "sum", | ||
| // "property", |
There was a problem hiding this comment.
Remove the commented line?
| return parent.id.name; | ||
| } | ||
|
|
||
| if (parent.right && parent.right.type == "ArrowFunctionExpression") { |
There was a problem hiding this comment.
You might be able to avoid the two conditions by using the isFunction helper I wrote.
if (parent.right && isFunction(parent.right) {
return parent.left.property.name;
}|
@ruturajv a couple comments, what do you mean by "pending variable searches"? |
|
@wldcordeiro - The original issue also wanted the object's members to be listed in search for "variables" ie for |
They already are though. There was an unresolved question about whether an object member should appear in both variables and functions. See this test. https://github.com/devtools-html/debugger.html/blob/master/src/utils/tests/parser.js#L112 |
| return parent.left.property.name; | ||
| } | ||
|
|
||
| if (parent.right && isFunction(parent.right)) { |
There was a problem hiding this comment.
This if condition is the same as the one above, it can be removed, otherwise this looks great.
|
thanks @wldcordeiro |
Associated Issue: #2323
Its a WIP patch :) please bear.