code: function movePropDefsToProto(proto) {
      var stype = proto.entityType || proto.complexType;
      var extra = stype._extra;
  
      var alreadyWrapped = extra.alreadyWrappedProps || {};
  
      stype.getProperties().forEach(function (prop) {
        var propName = prop.name;
        // we only want to wrap props that haven't already been wrapped
        if (alreadyWrapped[propName]) return;
  
        // If property is already defined on the prototype then wrap it in another propertyDescriptor.
        // otherwise create a propDescriptor for it.
        var descr;
        if (propName in proto) {
          descr = wrapPropDescription(proto, prop);
        } else {
          descr = makePropDescription(proto, prop);
        }
        // descr will be null for a wrapped descr that is not configurable
        if (descr != null) {
          Object.defineProperty(proto, propName, descr);
        }
        alreadyWrapped[propName] = true;
      });
      extra.alreadyWrappedProps = alreadyWrapped;
    }
docs: private methods This method is called during Metadata initialization to correctly "wrap" properties.