lib/class.js
function protectedFactory(instance) {
  var publicPrototype = Object.getPrototypeOf(instance);
  var protectedPrototype = protectToPrototypeMap.get(publicPrototype);
  if (!protectedPrototype) {
    throw new Error('The protected key function only accepts instances '
      + 'of objects created using Mozart constructors.'
    );
  }
  return Object.create(protectedPrototype);
}
function protectedFactory(instance) {
  var publicPrototype = Object.getPrototypeOf(instance);
  var protectedPrototype = protectToPrototypeMap.get(publicPrototype);
  if (!protectedPrototype) {
    throw new Error('The protected key function only accepts instances '
      + 'of objects created using Mozart constructors.'
    );
  }
  return Object.create(protectedPrototype);
}
function protectedFactory ( instance ) { var publicPrototype = Object . getPrototypeOf ( instance ) ; var protectedPrototype = protectToPrototypeMap . get ( publicPrototype ) ; if ( ! protectedPrototype ) { throw new Error ( 'The protected key function only accepts instances ' + 'of objects created using Mozart constructors.' ) ; } return Object . create ( protectedPrototype ) ; }
A creator function that can be passed to the Private Parts `createKey`
method. If accepts an object and return a new object whose prototype is
the protected counterpart to the prototype of the passed object.
@param {Object} instance An instance of a constructor created with Class.
@return {Object} The protected methods object.
A creator function that can be passed to the Private Parts createKey method . If accepts an object and return a new object whose prototype is the protected counterpart to the prototype of the passed object .