我想知道来自http://www.google.com来源的javascript文件实际上我经常这样做,并试图了解他们在那里做了什么.今天我想知道文件里面发现了一些奇怪的函数调用.也许这是一个愚蠢的事情,但我真的不知道它是什么,所以我无法帮助搜索它.
可读的代码 -
var someFunction = function(somaeParamenter){
//do some stuffs;
return something;
}
var someOtherThing = (0, someFunction)(oneParameter);
Run Code Online (Sandbox Code Playgroud)
请原谅我缺乏知识.
编辑:
资源-
我正在使用铬.在http://www.google.com页面打开时,我打开了开发人员工具.然后我打开了源选项卡并https://www.google.com.bd/xjs/_/js/s/c,sb,cr,cdos,vm,tbui,mb,wobnm,cfm,abd,bihu,kp,lu,m,tnv,amcl,erh,hv,lc,ob,r,rsn,sf,sfa,shb,srl,tbpr,hsm,j,p,pcc,csi/rt=j/ver=WUW4ydIf-wI.en_US./am=gA/d=1/sv=1/rs=AItRSTPu52CumknQsh0was81vrM4inla_w在查看器中打开了该文件.这个文件是我见过的唯一的js文件.我启用了"漂亮的打印",在第58行你会找到定义 -
_.Va = function(a) {
var b = typeof a;
if ("object" == b)
if (a) {
if (a instanceof window.Array)
return "array";
if (a instanceof window.Object)
return b;
var c = window.Object.prototype.toString.call(a);
if ("[object Window]" == c)
return "object";
if ("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice"))
return "array";
if ("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call"))
return "function"
} else
return "null";
else if ("function" == b && "undefined" == typeof a.call)
return "object";
return b
};
Run Code Online (Sandbox Code Playgroud)
在第83行,你会看到函数被调用.
_.Za = function(a) {
return "array" == (0, _.Va)(a)
};
Run Code Online (Sandbox Code Playgroud)
(0, someFunction)
Run Code Online (Sandbox Code Playgroud)
简单地回来 someFunction
所以这只相当于
var someOtherThing = someFunction(oneParameter);
Run Code Online (Sandbox Code Playgroud)
你确定你输入的确切吗?如果是这样,如果它不是某种混淆,那么它可能是一些缩小的不幸结果.例如(0, someObject.someFunction),如果实际代码稍有不同,则可能会使用此间接函数调用.
编辑:
您编辑确认目标可能是确保this在函数内部是全局对象(window在浏览器中)而不是Va附加的对象(_).
| 归档时间: |
|
| 查看次数: |
222 次 |
| 最近记录: |