Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function findValue(context) {
- let loop = context;
- do {
- if(loop.hasOwnProperty("values"))
- return loop.values;
- loop = loop.back();
- } while (loop != loop.back(-1))
- return {};
- }
- function recordValue(name) {
- return function(value) {
- let x = findValue(this);
- x[name] = value;
- this.values = x;
- return value;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment