Simplified the NODE tests
This commit is contained in:
parent
c1a3c3d477
commit
646acf3a8d
53 changed files with 106 additions and 89 deletions
|
|
@ -171,7 +171,7 @@ module.exports = function(grunt) {
|
|||
banner: '"use strict";\n\n',
|
||||
process: function(src, filepath) {
|
||||
return "// " + filepath + "\n\n" +
|
||||
src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(typeof\s+(module|APP_PCJS)\s*!==\s*(['"])undefined\2\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\([^\n]*\);[^\n]*/g, '');
|
||||
src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*if\s*\(typeof\s+(module|APP_PCJS)\s*!==\s*(['"])undefined\2\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\([^\n]*\);[^\n]*/g, '');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -182,7 +182,7 @@ module.exports = function(grunt) {
|
|||
banner: '"use strict";\n\n',
|
||||
process: function(src, filepath) {
|
||||
return "// " + filepath + "\n\n" +
|
||||
src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(typeof\s+(module|APP_PCJS)\s*!==\s*(['"])undefined\2\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\([^\n]*\);[^\n]*/g, '');
|
||||
src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/[ \t]*if\s*\(NODE\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*if\s*\(typeof\s+(module|APP_PCJS)\s*!==\s*(['"])undefined\2\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, '').replace(/[ \t]*[A-Za-z_][A-Za-z0-9_\.]*\.assert\([^\n]*\);[^\n]*/g, '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -439,6 +439,7 @@ module.exports = function(grunt) {
|
|||
grunt.loadNpmTasks("grunt-text-replace");
|
||||
|
||||
grunt.loadTasks("modules/grunts/manifester/tasks");
|
||||
|
||||
grunt.loadTasks("modules/grunts/prepjs/tasks");
|
||||
|
||||
grunt.registerTask("preCompiler", grunt.option("rebuild")? ["concat:tmp-c1pjs", "concat:tmp-pcjs"] : ["newer:concat:tmp-c1pjs", "newer:concat:tmp-pcjs"]);
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ var path = require("path");
|
|||
var http = require("http");
|
||||
var mkdirp = require("mkdirp");
|
||||
var crypto = require("crypto");
|
||||
var defines = require("../../shared/lib/defines");
|
||||
var net = require("../../shared/lib/netlib");
|
||||
var proc = require("../../shared/lib/proclib");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var mkdirp = require("mkdirp");
|
||||
var defines = require("../../shared/lib/defines");
|
||||
var net = require("../../shared/lib/netlib");
|
||||
var proc = require("../../shared/lib/proclib");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ var async = require("async");
|
|||
var parseXML = require("xml2js").parseString; // see: https://github.com/Leonidas-from-XIV/node-xml2js
|
||||
var unzip = require("unzip");
|
||||
var util = require("util");
|
||||
var defines = require("../../../shared/lib/defines");
|
||||
var net = require("../../../shared/lib/netlib");
|
||||
|
||||
module.exports = function (grunt) {
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ var glob = require("glob");
|
|||
* @property {function(string)} sync
|
||||
*/
|
||||
var HTTPAPI = require("./httpapi");
|
||||
var defines = require("../../shared/lib/defines");
|
||||
var DumpAPI = require("../../shared/lib/dumpapi");
|
||||
var MarkOut = require("../../markout");
|
||||
var net = require("../../shared/lib/netlib");
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
"use strict";
|
||||
|
||||
var path = require("path");
|
||||
var defines = require("../../shared/lib/defines");
|
||||
var net = require("../../shared/lib/netlib");
|
||||
var proc = require("../../shared/lib/proclib");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
var path = require("path");
|
||||
var fs = require("fs");
|
||||
var repl = require("repl");
|
||||
var defines = require("../../shared/lib/defines");
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var proc = require("../../shared/lib/proclib");
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
|
|
@ -1681,4 +1681,4 @@ Bus.prototype.reportError = function(op, addr, size)
|
|||
return false;
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = Bus;
|
||||
if (NODE) module.exports = Bus;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
|
|
@ -5293,4 +5293,4 @@ ChipSet.init = function()
|
|||
*/
|
||||
web.onInit(ChipSet.init);
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = ChipSet;
|
||||
if (NODE) module.exports = ChipSet;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
|
|
@ -1399,4 +1399,4 @@ web.onInit(Computer.init);
|
|||
web.onShow(Computer.show);
|
||||
web.onExit(Computer.exit);
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = Computer;
|
||||
if (NODE) module.exports = Computer;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
|
|
@ -1167,4 +1167,4 @@ CPU.prototype.yieldCPU = function()
|
|||
this.updateCPU();
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = CPU;
|
||||
if (NODE) module.exports = CPU;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
"use strict";
|
||||
|
||||
if (DEBUGGER) {
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
|
|
@ -1567,7 +1567,7 @@ if (DEBUGGER) {
|
|||
* AX == 0 means handle fault normally, 1 means issue TRAPFAULT
|
||||
*/
|
||||
cpu.regEAX = (cpu.regEAX & ~0xffff) | (this.fIgnoreNextCheckFault? 0 : 1);
|
||||
if (DEBUG) this.println("INT 0x41 CHECKFAULT: fault=" + str.toHexWord(BX) + " type=" + str.toHexWord(CX) + " trapped=" + !this.fIgnoreNextCheckFault);
|
||||
if (DEBUG) this.println("INT 0x41 CHECKFAULT: fault=" + str.toHexWord(BX) + " type=" + str.toHexWord(CX) + " trap=" + !this.fIgnoreNextCheckFault);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -7514,7 +7514,7 @@ if (DEBUGGER) {
|
|||
* Used with any command (eg, "r") that allows but doesn't require whitespace between command and first argument.
|
||||
*
|
||||
* @this {Debugger}
|
||||
* @param {Array.<string>} [asArgs]
|
||||
* @param {Array.<string>} asArgs
|
||||
* @return {Array.<string>}
|
||||
*/
|
||||
Debugger.prototype.shiftArgs = function(asArgs)
|
||||
|
|
@ -7730,4 +7730,4 @@ if (DEBUGGER) {
|
|||
|
||||
} // endif DEBUGGER
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = Debugger;
|
||||
if (NODE) module.exports = Debugger;
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ var COMPAQ386 = true;
|
|||
*/
|
||||
var PAGEBLOCKS = I386;
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
global.PCJSCLASS = PCJSCLASS;
|
||||
global.DEBUGGER = DEBUGGER;
|
||||
global.PREFETCH = PREFETCH;
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
|
|
@ -2769,4 +2769,4 @@ Disk.prototype.dumpSector = function(sector, pba, sDesc)
|
|||
return sDump;
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = Disk;
|
||||
if (NODE) module.exports = Disk;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var DiskAPI = require("../../shared/lib/diskapi");
|
||||
|
|
@ -2499,4 +2499,4 @@ FDC.init = function() {
|
|||
*/
|
||||
web.onInit(FDC.init);
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = FDC;
|
||||
if (NODE) module.exports = FDC;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var DiskAPI = require("../../shared/lib/diskapi");
|
||||
|
|
@ -2910,4 +2910,4 @@ HDC.init = function()
|
|||
*/
|
||||
web.onInit(HDC.init);
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = HDC;
|
||||
if (NODE) module.exports = HDC;
|
||||
|
|
|
|||
|
|
@ -2033,4 +2033,4 @@ if (DEBUGGER) {
|
|||
* entries for 16 segments.
|
||||
*/
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = Interrupts;
|
||||
if (NODE) module.exports = Interrupts;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
|
|
@ -2253,4 +2253,4 @@ Keyboard.init = function()
|
|||
*/
|
||||
web.onInit(Keyboard.init);
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = Keyboard;
|
||||
if (NODE) module.exports = Keyboard;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var Messages = require("./messages");
|
||||
|
|
@ -1334,4 +1334,4 @@ if (TYPEDARRAYS) {
|
|||
Memory.afnLittleEndian = [Memory.prototype.readByteLittleEndian, Memory.prototype.readShortLittleEndian, Memory.prototype.readLongLittleEndian, Memory.prototype.writeByteLittleEndian, Memory.prototype.writeShortLittleEndian, Memory.prototype.writeLongLittleEndian];
|
||||
}
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = Memory;
|
||||
if (NODE) module.exports = Memory;
|
||||
|
|
|
|||
|
|
@ -83,4 +83,4 @@ var Messages = {
|
|||
HALT: 0x80000000|0
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = Messages;
|
||||
if (NODE) module.exports = Messages;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
|
|
@ -731,4 +731,4 @@ Mouse.init = function()
|
|||
*/
|
||||
web.onInit(Mouse.init);
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = Mouse;
|
||||
if (NODE) module.exports = Mouse;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var usr = require("../../shared/lib/usrlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
|
|
@ -987,4 +987,4 @@ Panel.init = function()
|
|||
*/
|
||||
web.onInit(Panel.init);
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = Panel;
|
||||
if (NODE) module.exports = Panel;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
|
|
@ -590,4 +590,4 @@ CompaqController.prototype.getMemoryAccess = function()
|
|||
*/
|
||||
web.onInit(RAM.init);
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = RAM;
|
||||
if (NODE) module.exports = RAM;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var DumpAPI = require("../../shared/lib/dumpapi");
|
||||
|
|
@ -419,4 +419,4 @@ ROM.init = function()
|
|||
*/
|
||||
web.onInit(ROM.init);
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = ROM;
|
||||
if (NODE) module.exports = ROM;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var Messages = require("./messages");
|
||||
|
|
@ -837,4 +837,4 @@ SerialPort.init = function()
|
|||
*/
|
||||
web.onInit(SerialPort.init);
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = SerialPort;
|
||||
if (NODE) module.exports = SerialPort;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var web = require("./../../shared/lib/weblib");
|
||||
var Component = require("./../../shared/lib/component");
|
||||
var Messages = require("./messages");
|
||||
|
|
@ -414,4 +414,4 @@ State.prototype = {
|
|||
}
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = State;
|
||||
if (NODE) module.exports = State;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var DumpAPI = require("../../shared/lib/dumpapi");
|
||||
|
|
@ -7061,4 +7061,4 @@ Video.init = function()
|
|||
*/
|
||||
web.onInit(Video.init);
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = Video;
|
||||
if (NODE) module.exports = Video;
|
||||
|
|
|
|||
|
|
@ -535,4 +535,4 @@ X86.PS_SAHF = (X86.PS.CF | X86.PS.PF | X86.PS.AF | X86.PS.ZF | X86.PS.SF);
|
|||
*/
|
||||
X86.OPFLAG_PREFIXES = (X86.OPFLAG.SEG | X86.OPFLAG.LOCK | X86.OPFLAG.REPZ | X86.OPFLAG.REPNZ | X86.OPFLAG.DATASIZE | X86.OPFLAG.ADDRSIZE);
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = X86;
|
||||
if (NODE) module.exports = X86;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var web = require("../../shared/lib/weblib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
|
|
@ -48,11 +48,11 @@ if (typeof module !== 'undefined') {
|
|||
if (!I386) {
|
||||
/*
|
||||
* These are the original ModRM decoders, which were simpler and faster because they could treat all
|
||||
* word instructions as 16-bit, assume bits 15-31 of all registers were always zero, and use masking
|
||||
* word instructions as 16-bit, assume bits 16-31 of all registers were always zero, and use masking
|
||||
* constants instead of variables. If I386 is enabled, these decoders are not used, and the compiler
|
||||
* will eliminate them from the compiled code.
|
||||
*/
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var X86ModB = require("./x86modb");
|
||||
var X86ModW = require("./x86modw");
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ if (!I386) {
|
|||
* These are the more general-purpose ModRM decoders, required for I386 support. The current addressing
|
||||
* mode (16-bit or 32-bit) dynamically selects the appropriate set of decoders.
|
||||
*/
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var X86ModB16 = require("./x86modb16");
|
||||
var X86ModW16 = require("./x86modw16");
|
||||
var X86ModB32 = require("./x86modb32");
|
||||
|
|
@ -4698,4 +4698,4 @@ X86CPU.init = function()
|
|||
*/
|
||||
web.onInit(X86CPU.init);
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = X86CPU;
|
||||
if (NODE) module.exports = X86CPU;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var Messages = require("./messages");
|
||||
var X86 = require("./x86");
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var X86 = require("./x86");
|
||||
}
|
||||
|
||||
|
|
@ -8439,4 +8439,4 @@ X86ModB.aOpModGrp = [
|
|||
}
|
||||
];
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = X86ModB;
|
||||
if (NODE) module.exports = X86ModB;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var X86 = require("./x86");
|
||||
}
|
||||
|
||||
|
|
@ -8439,4 +8439,4 @@ X86ModB16.aOpModGrp = [
|
|||
}
|
||||
];
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = X86ModB16;
|
||||
if (NODE) module.exports = X86ModB16;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var X86 = require("./x86");
|
||||
}
|
||||
|
||||
|
|
@ -8439,4 +8439,4 @@ X86ModB32.aOpModGrp = [
|
|||
}
|
||||
];
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = X86ModB32;
|
||||
if (NODE) module.exports = X86ModB32;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var X86 = require("./x86");
|
||||
}
|
||||
|
||||
|
|
@ -2391,4 +2391,4 @@ X86ModSIB.aOpModSIB = [
|
|||
}
|
||||
];
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = X86ModSIB;
|
||||
if (NODE) module.exports = X86ModSIB;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var X86 = require("./x86");
|
||||
}
|
||||
|
||||
|
|
@ -9010,4 +9010,4 @@ X86ModW.aOpModGrp = [
|
|||
}
|
||||
];
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = X86ModW;
|
||||
if (NODE) module.exports = X86ModW;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var X86 = require("./x86");
|
||||
}
|
||||
|
||||
|
|
@ -9330,4 +9330,4 @@ X86ModW16.aOpModGrp = [
|
|||
}
|
||||
];
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = X86ModW16;
|
||||
if (NODE) module.exports = X86ModW16;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var X86 = require("./x86");
|
||||
}
|
||||
|
||||
|
|
@ -9330,4 +9330,4 @@ X86ModW32.aOpModGrp = [
|
|||
}
|
||||
];
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = X86ModW32;
|
||||
if (NODE) module.exports = X86ModW32;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var X86 = require("./x86");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var Component = require("../../shared/lib/component");
|
||||
var Messages = require("./messages");
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var str = require("../../shared/lib/strlib");
|
||||
var Messages = require("./messages");
|
||||
var Memory = require("./memory");
|
||||
|
|
@ -1565,4 +1565,4 @@ X86Seg.prototype.messageSeg = function(sel, base, limit, type, ext)
|
|||
}
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = X86Seg;
|
||||
if (NODE) module.exports = X86Seg;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
/* global window: true, DEBUG: true */
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
require("./defines");
|
||||
var usr = require("./usrlib");
|
||||
var web = require("./weblib");
|
||||
|
|
@ -997,4 +997,4 @@ Component.prototype = {
|
|||
}
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = Component;
|
||||
if (NODE) module.exports = Component;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,15 @@ var DEBUG = true; // this @define is overridden by the Closure Com
|
|||
*/
|
||||
var MAXDEBUG = false; // this @define is overridden by the Closure Compiler (to false) to remove MAXDEBUG-only code
|
||||
|
||||
/*
|
||||
* NODE should be true if we're running under NodeJS (eg, command-line), false if not (eg, web browser)
|
||||
*/
|
||||
var NODE = false;
|
||||
if (typeof module !== 'undefined') {
|
||||
NODE = true;
|
||||
}
|
||||
|
||||
if (NODE) {
|
||||
global.window = false; // provides an alternative "if (typeof window === 'undefined')" (ie, "if (window) ...")
|
||||
global.APPNAME = APPNAME;
|
||||
global.APPVERSION = APPVERSION;
|
||||
|
|
@ -72,6 +80,7 @@ if (typeof module !== 'undefined') {
|
|||
global.COMPILED = COMPILED;
|
||||
global.DEBUG = DEBUG;
|
||||
global.MAXDEBUG = MAXDEBUG;
|
||||
global.NODE = NODE;
|
||||
/*
|
||||
* TODO: When we're "required" by Node, should we return anything via module.exports?
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -215,4 +215,4 @@ DiskAPI.ATTR = {
|
|||
ARCHIVE: 0x20 // PC-DOS 2.0 and up
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = DiskAPI;
|
||||
if (NODE) module.exports = DiskAPI;
|
||||
|
|
|
|||
|
|
@ -82,4 +82,4 @@ var DumpAPI = {
|
|||
DumpAPI.asDiskCommands = [DumpAPI.QUERY.DIR, DumpAPI.QUERY.DISK, DumpAPI.QUERY.PATH];
|
||||
DumpAPI.asFileCommands = [DumpAPI.QUERY.FILE];
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = DumpAPI;
|
||||
if (NODE) module.exports = DumpAPI;
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
/* global window: true, XSLTProcessor: false, APPNAME: false, APPVERSION: false, DEBUG: true */
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var Component;
|
||||
var str = require("./strlib");
|
||||
var web = require("./weblib");
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
var net = {};
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var sServerRoot;
|
||||
var fs = require("fs");
|
||||
var http = require("http");
|
||||
|
|
@ -396,4 +396,4 @@ net.loadResource = function(sURL, fAsync, data, componentNotify, fnNotify, pNoti
|
|||
return [nErrorCode, sResponse];
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = net;
|
||||
if (NODE) module.exports = net;
|
||||
|
|
|
|||
|
|
@ -87,4 +87,4 @@ proc.getArgs = function() {
|
|||
return {argc: argc, argv: argv};
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = proc;
|
||||
if (NODE) module.exports = proc;
|
||||
|
|
|
|||
|
|
@ -50,4 +50,4 @@ var ReportAPI = {
|
|||
}
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = ReportAPI;
|
||||
if (NODE) module.exports = ReportAPI;
|
||||
|
|
@ -402,4 +402,4 @@ str.trim = function(s)
|
|||
return s.replace(/^\s+|\s+$/g, "");
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = str;
|
||||
if (NODE) module.exports = str;
|
||||
|
|
|
|||
|
|
@ -70,4 +70,4 @@ var UserAPI = {
|
|||
}
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = UserAPI;
|
||||
if (NODE) module.exports = UserAPI;
|
||||
|
|
@ -316,4 +316,4 @@ usr.indexOf = function(a, t, i)
|
|||
return -1;
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = usr;
|
||||
if (NODE) module.exports = usr;
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@
|
|||
|
||||
/* global window: true, setTimeout: false, clearTimeout: false, SITEHOST: false */
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
var Component;
|
||||
require("./defines");
|
||||
var str = require("./strlib");
|
||||
|
|
@ -147,7 +147,7 @@ var web = {};
|
|||
*/
|
||||
web.log = function(s, type)
|
||||
{
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
if (!Component) Component = require("./component");
|
||||
}
|
||||
Component.log(s, type);
|
||||
|
|
@ -164,7 +164,7 @@ web.log = function(s, type)
|
|||
*/
|
||||
web.notice = function(s, fPrintOnly, id)
|
||||
{
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
if (!Component) Component = require("./component");
|
||||
}
|
||||
Component.notice(s, fPrintOnly, id);
|
||||
|
|
@ -191,7 +191,7 @@ web.notice = function(s, fPrintOnly, id)
|
|||
web.loadResource = function(sURL, fAsync, data, componentNotify, fnNotify, pNotify)
|
||||
{
|
||||
fAsync = !!fAsync; // ensure that fAsync is a valid boolean (Internet Explorer xmlHTTP functions insist on it)
|
||||
if (typeof module !== 'undefined') {
|
||||
if (NODE) {
|
||||
/*
|
||||
* We don't even need to load Component, because we can't use any of the code below
|
||||
* within Node anyway. Instead, we must hand this request off to our network library.
|
||||
|
|
@ -816,4 +816,4 @@ web.onPageEvent('onload', function onPageLoad() { web.fPageReady = true; web.doP
|
|||
web.onPageEvent('onpageshow', function onPageShow() { web.doPageEvent(web.aPageEventHandlers['show']); });
|
||||
web.onPageEvent(web.isUserAgent("Opera") || web.isUserAgent("iOS")? 'onunload' : 'onbeforeunload', function onPageUnload() { web.doPageEvent(web.aPageEventHandlers['exit']); });
|
||||
|
||||
if (typeof module !== 'undefined') module.exports = web;
|
||||
if (NODE) module.exports = web;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ var http = require("http");
|
|||
var express = require("express");
|
||||
var slash = require("express-slash");
|
||||
|
||||
var defines = require("./modules/shared/lib/defines");
|
||||
var proclib = require("./modules/shared/lib/proclib");
|
||||
var args = proclib.getArgs();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue