From 5b99b51c64443947757fed2dbd265e5bf829912f Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Fri, 6 Mar 2015 11:37:29 -0800 Subject: [PATCH] Remove useless globals --- modules/pcjs/lib/.jshintrc | 1 - modules/pcjs/lib/bus.js | 2 -- modules/pcjs/lib/chipset.js | 2 -- modules/pcjs/lib/computer.js | 2 -- modules/pcjs/lib/cpu.js | 2 -- modules/pcjs/lib/debugger.js | 2 -- modules/pcjs/lib/defines.js | 8 -------- modules/pcjs/lib/disk.js | 2 -- modules/pcjs/lib/fdc.js | 2 -- modules/pcjs/lib/hdc.js | 2 -- modules/pcjs/lib/keyboard.js | 2 -- modules/pcjs/lib/memory.js | 2 -- modules/pcjs/lib/mouse.js | 2 -- modules/pcjs/lib/panel.js | 2 -- modules/pcjs/lib/ram.js | 2 -- modules/pcjs/lib/rom.js | 2 -- modules/pcjs/lib/serialport.js | 2 -- modules/pcjs/lib/state.js | 2 -- modules/pcjs/lib/video.js | 4 +--- modules/pcjs/lib/x86cpu.js | 6 ------ 20 files changed, 1 insertion(+), 50 deletions(-) diff --git a/modules/pcjs/lib/.jshintrc b/modules/pcjs/lib/.jshintrc index 39b1bc8c0..dfdf84cae 100644 --- a/modules/pcjs/lib/.jshintrc +++ b/modules/pcjs/lib/.jshintrc @@ -6,7 +6,6 @@ "sub": true, "globalstrict": true, "globals": { - "APP_PCJS": true, "APPNAME": false, "APPVERSION": false, "SITEHOST": false, diff --git a/modules/pcjs/lib/bus.js b/modules/pcjs/lib/bus.js index 0eeac47fe..4d9c435b8 100644 --- a/modules/pcjs/lib/bus.js +++ b/modules/pcjs/lib/bus.js @@ -1466,6 +1466,4 @@ Bus.prototype.reportError = function(op, addr, size) return false; }; -if (typeof APP_PCJS !== 'undefined') APP_PCJS.Bus = Bus; - if (typeof module !== 'undefined') module.exports = Bus; diff --git a/modules/pcjs/lib/chipset.js b/modules/pcjs/lib/chipset.js index 17fbf8eae..9cc9d4f30 100644 --- a/modules/pcjs/lib/chipset.js +++ b/modules/pcjs/lib/chipset.js @@ -5020,6 +5020,4 @@ ChipSet.init = function() */ web.onInit(ChipSet.init); -if (typeof APP_PCJS !== 'undefined') APP_PCJS.ChipSet = ChipSet; - if (typeof module !== 'undefined') module.exports = ChipSet; diff --git a/modules/pcjs/lib/computer.js b/modules/pcjs/lib/computer.js index a84b19649..1bbbc2097 100644 --- a/modules/pcjs/lib/computer.js +++ b/modules/pcjs/lib/computer.js @@ -1355,6 +1355,4 @@ web.onInit(Computer.init); web.onShow(Computer.show); web.onExit(Computer.exit); -if (typeof APP_PCJS !== 'undefined') APP_PCJS.Computer = Computer; - if (typeof module !== 'undefined') module.exports = Computer; diff --git a/modules/pcjs/lib/cpu.js b/modules/pcjs/lib/cpu.js index 22602e2b7..d9a8282e1 100644 --- a/modules/pcjs/lib/cpu.js +++ b/modules/pcjs/lib/cpu.js @@ -1137,6 +1137,4 @@ CPU.prototype.yieldCPU = function() this.updateCPU(); }; -if (typeof APP_PCJS !== 'undefined') APP_PCJS.CPU = CPU; - if (typeof module !== 'undefined') module.exports = CPU; diff --git a/modules/pcjs/lib/debugger.js b/modules/pcjs/lib/debugger.js index 18c051465..f5a1064d7 100644 --- a/modules/pcjs/lib/debugger.js +++ b/modules/pcjs/lib/debugger.js @@ -5188,8 +5188,6 @@ if (DEBUGGER) { */ web.onInit(Debugger.init); - if (typeof APP_PCJS !== 'undefined') APP_PCJS.Debugger = Debugger; - } // endif DEBUGGER if (typeof module !== 'undefined') module.exports = Debugger; diff --git a/modules/pcjs/lib/defines.js b/modules/pcjs/lib/defines.js index e5f7bae83..c42d2abf0 100644 --- a/modules/pcjs/lib/defines.js +++ b/modules/pcjs/lib/defines.js @@ -32,14 +32,6 @@ "use strict"; -/** - * APP_PCJS collects all PCjs application globals in one convenient place - */ -if (DEBUG) { - var APP_PCJS = {Component: null}; - if (typeof Component === 'function') APP_PCJS.Component = Component; -} - /** * @define {string} */ diff --git a/modules/pcjs/lib/disk.js b/modules/pcjs/lib/disk.js index 1de4f3239..fe163e242 100644 --- a/modules/pcjs/lib/disk.js +++ b/modules/pcjs/lib/disk.js @@ -2166,6 +2166,4 @@ Disk.prototype.dumpSector = function(sector, pba, sDesc) return sDump; }; -if (typeof APP_PCJS !== 'undefined') APP_PCJS.Disk = Disk; - if (typeof module !== 'undefined') module.exports = Disk; diff --git a/modules/pcjs/lib/fdc.js b/modules/pcjs/lib/fdc.js index 2f8f89522..e2a262fce 100644 --- a/modules/pcjs/lib/fdc.js +++ b/modules/pcjs/lib/fdc.js @@ -2497,6 +2497,4 @@ FDC.init = function() { */ web.onInit(FDC.init); -if (typeof APP_PCJS !== 'undefined') APP_PCJS.FDC = FDC; - if (typeof module !== 'undefined') module.exports = FDC; diff --git a/modules/pcjs/lib/hdc.js b/modules/pcjs/lib/hdc.js index f686849f0..2eb9eedf8 100644 --- a/modules/pcjs/lib/hdc.js +++ b/modules/pcjs/lib/hdc.js @@ -2854,6 +2854,4 @@ HDC.init = function() */ web.onInit(HDC.init); -if (typeof APP_PCJS !== 'undefined') APP_PCJS.HDC = HDC; - if (typeof module !== 'undefined') module.exports = HDC; diff --git a/modules/pcjs/lib/keyboard.js b/modules/pcjs/lib/keyboard.js index 4831cabb6..0fee781b5 100644 --- a/modules/pcjs/lib/keyboard.js +++ b/modules/pcjs/lib/keyboard.js @@ -2234,6 +2234,4 @@ Keyboard.init = function() */ web.onInit(Keyboard.init); -if (typeof APP_PCJS !== 'undefined') APP_PCJS.Keyboard = Keyboard; - if (typeof module !== 'undefined') module.exports = Keyboard; diff --git a/modules/pcjs/lib/memory.js b/modules/pcjs/lib/memory.js index 6c32f0b35..3166435e1 100644 --- a/modules/pcjs/lib/memory.js +++ b/modules/pcjs/lib/memory.js @@ -1006,6 +1006,4 @@ Memory.prototype = { } }; -if (typeof APP_PCJS !== 'undefined') APP_PCJS.Memory = Memory; - if (typeof module !== 'undefined') module.exports = Memory; diff --git a/modules/pcjs/lib/mouse.js b/modules/pcjs/lib/mouse.js index 3ed036925..b7a67240a 100644 --- a/modules/pcjs/lib/mouse.js +++ b/modules/pcjs/lib/mouse.js @@ -656,6 +656,4 @@ Mouse.init = function() */ web.onInit(Mouse.init); -if (typeof APP_PCJS !== 'undefined') APP_PCJS.Mouse = Mouse; - if (typeof module !== 'undefined') module.exports = Mouse; diff --git a/modules/pcjs/lib/panel.js b/modules/pcjs/lib/panel.js index ec974e1d1..7c5341cca 100644 --- a/modules/pcjs/lib/panel.js +++ b/modules/pcjs/lib/panel.js @@ -955,6 +955,4 @@ Panel.init = function() */ web.onInit(Panel.init); -if (typeof APP_PCJS !== 'undefined') APP_PCJS.Panel = Panel; - if (typeof module !== 'undefined') module.exports = Panel; diff --git a/modules/pcjs/lib/ram.js b/modules/pcjs/lib/ram.js index 9a1a5f4df..1a17dd057 100644 --- a/modules/pcjs/lib/ram.js +++ b/modules/pcjs/lib/ram.js @@ -359,6 +359,4 @@ CompaqController.prototype.getMemoryAccess = function() */ web.onInit(RAM.init); -if (typeof APP_PCJS !== 'undefined') APP_PCJS.RAM = RAM; - if (typeof module !== 'undefined') module.exports = RAM; diff --git a/modules/pcjs/lib/rom.js b/modules/pcjs/lib/rom.js index bc9c5a246..04a87bb4e 100644 --- a/modules/pcjs/lib/rom.js +++ b/modules/pcjs/lib/rom.js @@ -377,6 +377,4 @@ ROM.init = function() */ web.onInit(ROM.init); -if (typeof APP_PCJS !== 'undefined') APP_PCJS.ROM = ROM; - if (typeof module !== 'undefined') module.exports = ROM; diff --git a/modules/pcjs/lib/serialport.js b/modules/pcjs/lib/serialport.js index 4ba60d39d..241f6504a 100644 --- a/modules/pcjs/lib/serialport.js +++ b/modules/pcjs/lib/serialport.js @@ -761,6 +761,4 @@ SerialPort.init = function() { */ web.onInit(SerialPort.init); -if (typeof APP_PCJS !== 'undefined') APP_PCJS.SerialPort = SerialPort; - if (typeof module !== 'undefined') module.exports = SerialPort; diff --git a/modules/pcjs/lib/state.js b/modules/pcjs/lib/state.js index 9514c32a5..0b4f079cb 100644 --- a/modules/pcjs/lib/state.js +++ b/modules/pcjs/lib/state.js @@ -414,6 +414,4 @@ State.prototype = { } }; -if (typeof APP_PCJS !== 'undefined') APP_PCJS.State = State; - if (typeof module !== 'undefined') module.exports = State; diff --git a/modules/pcjs/lib/video.js b/modules/pcjs/lib/video.js index 3ac4d2d76..f96a9b00e 100644 --- a/modules/pcjs/lib/video.js +++ b/modules/pcjs/lib/video.js @@ -66,7 +66,7 @@ if (typeof module !== 'undefined') { * switches: string representing EGA switches (see "SW1-SW4" documentation below) * memory: the size of the EGA's on-board memory (overrides EGA's Video.cardSpecs) * - * This calls the CPU to allocate a video buffer at the appropriate memory location whenever + * This calls the Bus to allocate a video buffer at the appropriate memory location whenever * a reset() or setMode() occurs; setMode() is called whenever a mode change is detected at * the port level, and whenever reset() is called. setMode() also invokes updateScreen(true), * which forces reallocation of our internal buffer (aCellCache) that mirrors the video buffer. @@ -5348,6 +5348,4 @@ Video.init = function() */ web.onInit(Video.init); -if (typeof APP_PCJS !== 'undefined') {APP_PCJS.Card = Card; APP_PCJS.Video = Video;} - if (typeof module !== 'undefined') module.exports = Video; diff --git a/modules/pcjs/lib/x86cpu.js b/modules/pcjs/lib/x86cpu.js index 612198eee..8bc415d1c 100644 --- a/modules/pcjs/lib/x86cpu.js +++ b/modules/pcjs/lib/x86cpu.js @@ -3334,10 +3334,4 @@ X86CPU.init = function() */ web.onInit(X86CPU.init); -if (typeof APP_PCJS !== 'undefined') { - APP_PCJS.X86 = X86; - APP_PCJS.X86.X86CPU = X86CPU; - APP_PCJS.X86.X86Seg = X86Seg; -} - if (typeof module !== 'undefined') module.exports = X86CPU;