From 8e1dd595eca107e8c590fa157e269dd5c32a5423 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 26 Oct 2016 13:25:02 -0700 Subject: [PATCH] Noticed some more problems in older (albeit unsupported) browsers --- modules/pcx86/lib/chipset.js | 5 ++++- modules/pcx86/lib/fdc.js | 9 ++++++++- modules/shared/lib/component.js | 9 +++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/modules/pcx86/lib/chipset.js b/modules/pcx86/lib/chipset.js index da46f30cb..5d796a9c1 100644 --- a/modules/pcx86/lib/chipset.js +++ b/modules/pcx86/lib/chipset.js @@ -3461,7 +3461,10 @@ ChipSet.prototype.advanceDMA = function(channel, fInit) } if (!channel.masked) { chipset.bus.setByte(addrCur, b); - if (BACKTRACK) { + /* + * WARNING: Do NOT assume that obj is valid; if the sector data was not found, there will be no obj. + */ + if (BACKTRACK && obj) { if (!off && obj.file) { if (chipset.messageEnabled(Messages.DISK)) { chipset.printMessage("loading " + obj.file.sPath + '[' + obj.offFile + "] at %" + str.toHex(addrCur), true); diff --git a/modules/pcx86/lib/fdc.js b/modules/pcx86/lib/fdc.js index c4aafc8fb..88a200338 100644 --- a/modules/pcx86/lib/fdc.js +++ b/modules/pcx86/lib/fdc.js @@ -470,7 +470,14 @@ FDC.prototype.setBinding = function(sHTMLType, sBinding, control, sValue) } }); for (i = 0; i < aOptions.length; i++) { - control.options[i] = aOptions[i]; + try { + /* + * TODO: Determine why this line blows up in IE8; are the properties of an options object not settable in IE8? + */ + control.options[i] = aOptions[i]; + } catch(e) { + break; + } } } diff --git a/modules/shared/lib/component.js b/modules/shared/lib/component.js index f2ab6865e..da0b718c6 100644 --- a/modules/shared/lib/component.js +++ b/modules/shared/lib/component.js @@ -1077,6 +1077,15 @@ if (!Array.prototype.indexOf) { } } +/* + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray + */ +if (!Array.isArray) { + Array.isArray = function (arg) { + return Object.prototype.toString.call(arg) === '[object Array]'; + }; +} + /* * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind */