How does the Structure window work with JS files?

It is getting really hard to me to understand the Structure window, i have the following code:

'use strict';

var MyClass = module.exports = function () {};

MyClass.staticMethod = function () {
  console.log('static method');
};

MyClass.instance.instanceMethod = function () {
  console.log('instance method');
};

MyClass.staticField = 'static field';




Then the structure window shows:

(c) exports
  (m) exports()
  (m) staticMethod()
(c) module
  (c) exports
(v) MyClass
  (c) instance

A class "exports" with 2 methods/functions exports() and staticMethod()
A class module with a another class exports
A variable MyClass with a class instance

That does not make much sense to me... I've tried to add jsdoc annotations to mark static functions and functions without success...

Please sign in to leave a comment.