Guest User

Untitled

a guest
May 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. function mix(...mixins){
  2. class Mix{};
  3. for (let mixin of mixins){
  4. copyProperties(Mix,mixin);
  5. copyProperties(Mix.prototype,mixin.prototype);
  6. }
  7. }
  8. function copyProperties(target,source){
  9. for (let key of Reflect.ownKeys(source)){
  10. if(key !== 'constructor' && key !== 'prototype' && key !== 'name'){
  11. let desc = Object.getOwnPropertyDescriptor(source,key);
  12. Object.defineProperty(target,key,desc);
  13. }
  14. }
  15. }
  16. class DistributedEdit extends mix(){}
Add Comment
Please, Sign In to add comment