flymis/WebRoot/dojojs/src/lang/func.js
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.lang.func");
dojo.require("dojo.lang.common");
/**
* Runs a function in a given scope (thisObject), can
* also be used to preserve scope.
*
* hitch(foo, "bar"); // runs foo.bar() in the scope of foo
* hitch(foo, myFunction); // runs myFunction in the scope of foo
*/
dojo.lang.hitch = function(thisObject, method){
var fcn = (dojo.lang.isString(method) ? thisObject[method] : method) || function(){};
return function() {
return fcn.apply(thisObject, arguments);
};
}
dojo.lang.anonCtr = 0;
dojo.lang.anon = {};
dojo.lang.nameAnonFunc = function(anonFuncPtr, namespaceObj, searchForNames){
var nso = (namespaceObj || dojo.lang.anon);
if( (searchForNames) ||
((dj_global["djConfig"])&&(djConfig["slowAnonFuncLookups"] == true)) ){
for(var x in nso){
try{
if(nso[x] === anonFuncPtr){
return x;
}
}catch(e){} // window.external fails in IE embedded in Eclipse (Eclipse bug #151165)
}
}
var ret = "__"+dojo.lang.anonCtr++;
while(typeof nso[ret] != "undefined"){
ret = "__"+dojo.lang.anonCtr++;
}
nso[ret] = anonFuncPtr;
return ret;
}
dojo.lang.forward = function(funcName){
// Returns a function that forwards a method call to this.func(...)
return function(){
return this[funcName].apply(this, arguments);
};
}
dojo.lang.curry = function(ns, func /* args ... */){
var outerArgs = [];
后面还有 88 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。