Community
Participate
Working Groups
Types in JavaScript can have methods/fields added to them across multiple files. The hierarchy builder works with ITypes and caches things based on iType (the first one it finds). This can be a problem if the methods/fields we are interested in happen to be in a different iType. There is some code in the hierarchy builder that incorrectly checks the cache for a InferredType and claims it is not in there because it is using a different iType to search the cache than the one that is stored in there. This causes duplicate sub-type hierarchies to be built...this is a pretty big performance hit. In the long-term we really need to fix the Hierarchy code to understand how JavaScript handles types, but in the short term we can comment out a bit of code and prevent duplicate hierarchy builds.
Created attachment 194769 [details] patch
It's a little clearer if you understand that the ITypes also have the same names, just different properties defined from different files. Changing the TypeHierarchy class to properly work based on the type's name rather than an IType instance would make for a much larger change.
Committed to R3_2_4_patches