-
Notifications
You must be signed in to change notification settings - Fork 1.8k
JS: cleanup in API-graphs #5460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
any(TypeAnnotation n).hasQualifiedName(m, _) | ||
or | ||
any(Type t).hasUnderlyingType(m, _) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a regression test that demonstrates the need for this addition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm. I can't find a situation where that line is needed. The imports(_, m)
seems to cover all the cases I can come up with.
I still think it's a good idea to have, to have consistency with the MkHasUnderlyingType
implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@erik-krogh, I made a PR against this branch (erik-krogh#2) to add back something that's roughly equivalent to the (useful parts of) (Happy to put it up as a separate PR if you prefer.) |
It looks OK to me, and I like the renaming. But to me it looks like the new def node doesn't have an rhs, and it doesn't have any successors. |
Currently yes. The reason these nodes don't have an rhs is that their rhs would be a type definition, which isn't a data-flow node. For much the same reason, I think it would be useful to consider giving |
...and now ppa.launchpad.net is unreachable; fun times! |
Ah, that's better! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it's not really clear to me what the status of this PR is. Was there a 👍 from @max-schaefer and has there been an evaluation?
Yes, that's a 👍 from me, but as a co-author of the PR I'd appreciate another pair of eyes. I think the last evaluation was from before my contributions. |
An updated evaluation shows a performance regression, but I think it is within the margin of error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late comment; I've looked over this PR several times already but always gotten bewildered by the lack context. It's just not clear to me why we're making this change.
@@ -837,9 +825,13 @@ module API { | |||
) | |||
or | |||
exists(string moduleName, string exportName | | |||
pred = MkModuleExport(moduleName) and | |||
lbl = Label::member(exportName) and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change it seems we're again mixing up type-names and value-names which I thought we could finally avoid when we introduced Node::ofType
.
For example, for a module with exports
export const Foo = function() { .. }
export interface Foo { ... }
Doing getMember("Foo").getInstance()
will return the nodes for both new Foo()
and nodes for expressions of type Foo
, which seem like they should always be the same, but often are not.
To get this straight we'd either need a separate member
edge like typeMember
for accessing the types exported from a namespace, or stop using instance
for representing expression of a given type.
@asgerf, it looks like your comments concern my additions to this PR. If @erik-krogh's original changes look good to you, then I suggest we back out my changes. They aren't high-priority enough for me to invest time in right now. |
Okay, well that's unfortunate. I think renaming the node to |
Changes based on some late feedback from #5419
I deleted the remaining references to
CanonicalName
, as they were no longer needed.And added
any(Type t).hasUnderlyingType(m, _)
to get make sure all module names are recognized.