MCPcopy Index your code
hub / github.com/hoothin/UserScripts / data

Function data

FlashViewer-HTML5 Video/flashViewer.user.js:353–366  ·  view source on GitHub ↗
(obj, key, value)

Source from the content-addressed store, hash-verified

351
352
353 function data(obj, key, value) {
354 var id = cache.objs.indexOf(obj);
355 if (id == -1) {
356 id = cache.objs.push(obj) - 1;
357 };
358 if (!cache.data[id]) {//初始化
359 cache.data[id] = {};
360 };
361 if (typeof value == 'undefined') {// 取值
362 return typeof key == 'undefined' ? cache.data[id] : cache.data[id][key];
363 } else {
364 return cache.data[id][key] = value;
365 };
366 };
367
368 return data;
369 })();

Callers 1

contentScriptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected