classPrivateFieldGet.js 356 B

123456789101112131415
  1. function _classPrivateFieldGet(receiver, privateMap) {
  2. if (!privateMap.has(receiver)) {
  3. throw new TypeError("attempted to get private field on non-instance");
  4. }
  5. var descriptor = privateMap.get(receiver);
  6. if (descriptor.get) {
  7. return descriptor.get.call(receiver);
  8. }
  9. return descriptor.value;
  10. }
  11. module.exports = _classPrivateFieldGet;