MCPcopy Create free account
hub / github.com/hoothin/UserScripts / getMStr

Function getMStr

FlashViewer-HTML5 Video/flashViewer.user.js:417–430  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

415
416 // 从函数中获取多行注释的字符串
417 function getMStr(fn) {
418 var fnSource = fn.toString();
419 var ret = {};
420 fnSource = fnSource.replace(/^[^{]+/, '');
421 // console.log(fnSource);
422 var matched;
423 var reg = /var\s+([$\w]+)[\s\S]*?\/\*([\s\S]+?)\*\//g;
424 while (matched = reg.exec(fnSource)) {
425 // console.log(matched);
426 ret[matched[1]] = matched[2];
427 };
428
429 return ret;
430 };
431
432 //对象克隆,接受{}和[]
433 function cloneObject(obj, deep) {

Callers 1

contentScriptFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected