我遇到了未定义变量错误的问题。这是我的代码:
window.sys.Bash = {};
window.sys.Bash.version = "";
window.sys.Bash.version.major = 0;
window.sys.Bash.version.minor = 1;
window.sys.Bash.version.build = 1;
window.sys.Bash.version.release = "beta";
window.sys.Bash.printing = false;
window.sys.Bash.queue = Array();
window.sys.Bash.span = bash;
window.sys.Bash.span.input = input;
window.sys.Bash.version = ""
+ window.sys.Bash.version.major + "."
+ window.sys.Bash.version.minor + "."
+ Array(2-window.sys.Bash.version.build.toString().length+1).join('0')
+ window.sys.Bash.version.build + "-"
+ window.sys.Bash.version.release + " "
+ "(x86_64-" + window.sys.platform + ")";
delete bash; delete input;
我的 Web 控制台说,window.sys.Bash.version.build 在这一行没有定义:
+ Array(2-window.sys.Bash.version.build.toString().length+1).join('0')
我从这里复制了代码,所以我不太了解它,但它应该可以工作,对吧?