docs: function _createMetadata(prototype) {
      let basePrototype = Object.getPrototypeOf(prototype);
  
      let metadata = Object.create(Metadata).init();
      // manually copy properties from the prototypes metadata
      if (basePrototype._espDecoratorMetadata) {
          for (let e of basePrototype._espDecoratorMetadata._events) {
              metadata._events.push(e);
          }
      }
      // define an enumerable property on the constructors to hold the metadata.
      // It needs to be enumerable so TS extends can copy it accross.
      Object.defineProperty(prototype, '_espDecoratorMetadata', {
          value: metadata,
          // by default enumerable is false, I'm just being explicit here.
          // When Typescript derives from a base class it copies all own property to the new instance we don't want the metadata copied.
          // To stop it we set enumerable to false. You'd expect this to work using prototypical inheritance so you can override via the prototype chain.
          // Last I looked that's how babel worked.
          enumerable: false
      });
      return metadata;
  }