* Enable property storage to any host object. * Notice: Serialization is not supported. * * For example: * var inner = zrUitl.makeInner(); * * function some1(hostObj) { * inner(hostObj).someProperty = 1212; * ... * } * function some2() { * var fields = inner(this); *
()
| 12058 | * @return {Function} |
| 12059 | */ |
| 12060 | function makeInner() { |
| 12061 | // Consider different scope by es module import. |
| 12062 | var key = '__\0ec_inner_' + innerUniqueIndex++ + '_' + Math.random().toFixed(5); |
| 12063 | return function (hostObj) { |
| 12064 | return hostObj[key] || (hostObj[key] = {}); |
| 12065 | }; |
| 12066 | } |
| 12067 | var innerUniqueIndex = 0; |
| 12068 | |
| 12069 | /** |
no test coverage detected