3

I want to enumerate the different object types in a large Javascript program. This has been fairly easy by recursive walking the objects (starting at 'window') and looking at their prototypes. For example, function Fred() {...} shows up in iteration as window.Fred

However, class Bill {...} does not make Bill visible in window, and in quite a bit of Google searching I have not managed to find out how I can introspect the system to find Bill. (lots about how to look inside Bill once I have found him). Can anyone tell me how to find the active classes such as Bill, please?

Stephen Todd
  • 365
  • 3
  • 12
  • 1
    https://stackoverflow.com/questions/37711603/javascript-es6-class-definition-not-accessible-in-window-global – Paul Fitzgerald Aug 16 '17 at 09:27
  • Possible duplicate of [Javascript ES6 class definition not accessible in window global](https://stackoverflow.com/questions/37711603/javascript-es6-class-definition-not-accessible-in-window-global) – str Aug 16 '17 at 09:33
  • 1
    You can't and you shouldn't. It's not clear what you want it for. If you need to have a list of them for documentation purposes, consider using doc generators like JSDoc or ESDoc. – Estus Flask Aug 16 '17 at 11:13

0 Answers0