write()/read() now work for script files. You can now use angled brackets in tprint() (and create DOM elements). Added CodingContract implementation

This commit is contained in:
danielyxie
2018-09-14 16:03:31 -05:00
parent b66c3c6fc4
commit 420fd0c5ad
12 changed files with 912 additions and 74 deletions
+14 -1
View File
@@ -57,7 +57,7 @@ WorkerScript.prototype.getServer = function() {
//Returns the Script object for the underlying script
WorkerScript.prototype.getScript = function() {
let server = this.getServer();
for (var i = 0; i < server.scripts.length; ++i) {
for (let i = 0; i < server.scripts.length; ++i) {
if (server.scripts[i].filename === this.name) {
return server.scripts[i];
}
@@ -66,6 +66,19 @@ WorkerScript.prototype.getScript = function() {
return null;
}
//Returns the Script object for the specified script
WorkerScript.prototype.getScriptOnServer = function(fn, server) {
if (server == null) {
server = this.getServer();
}
for (let i = 0; i < server.scripts.length; ++i) {
if (server.scripts[i].filename === fn) {
return server.scripts[i];
}
}
return null;
}
WorkerScript.prototype.shouldLog = function(fn) {
return (this.disableLogs.ALL == null && this.disableLogs[fn] == null);
}