flymis/WebRoot/dojojs/src/hostenv_rhino.js
(开头部分) 8KB这里只显示每个文件的开头 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
*/
/*
* Rhino host environment
*/
// make jsc shut up (so we can use jsc for sanity checking)
/*@cc_on
@if (@_jscript_version >= 7)
var loadClass; var print; var load; var quit; var version; var Packages; var java;
@end
@*/
dojo.hostenv.println=function(line){
print(line);
}
dojo.locale = dojo.locale || java.util.Locale.getDefault().toString().replace('_','-').toLowerCase();
dojo.render.name = dojo.hostenv.name_ = 'rhino';
dojo.hostenv.getVersion = function() {return version();};
if (dj_undef("byId")) {
dojo.byId = function(id, doc){
if(id && (typeof id == "string" || id instanceof String)){
if(!doc){ doc = document; }
return doc.getElementById(id);
}
return id; // assume it's a node
}
}
// see comments in spidermonkey loadUri
dojo.hostenv.loadUri = function(uri, cb){
try{
var local = (new java.io.File(uri)).exists();
if(!local){
try{
// try it as a file first, URL second
var stream = (new java.net.URL(uri)).openStream();
// close the stream so we don't leak resources
stream.close();
}catch(e){
// no debug output; this failure just means the uri was not found.
return false;
}
}
//FIXME: Use Rhino 1.6 native readFile/readUrl if available?
if(cb){
var contents = (local ? readText : readUri)(uri, "UTF-8");
cb(eval('('+contents+')'));
}else{
load(uri);
}
后面还有 186 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。