Guest User

Untitled

a guest
Dec 29th, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     function findValue(context) {
  2.       let loop = context;
  3.       do {
  4.           if(loop.hasOwnProperty("values"))
  5.             return loop.values;
  6.           loop = loop.back();
  7.       } while (loop != loop.back(-1))
  8.         return {};
  9.     }
  10.  
  11.     function recordValue(name) {
  12.       return function(value) {
  13.         let x = findValue(this);
  14.         x[name] = value;
  15.         this.values = x;
  16.         return value;
  17.       }
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment