diff --git a/common/content/dactyl.js b/common/content/dactyl.js index cf441ce1..f3f10481 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1003,7 +1003,7 @@ const Dactyl = Module("dactyl", { * @param {Object} error The error object. */ reportError: function reportError(error, echo) { - if (error instanceof FailedAssertion) { + if (error instanceof FailedAssertion || error.message === "Interrupted") { if (error.message) dactyl.echoerr(error.message); else diff --git a/common/content/events.js b/common/content/events.js index f0cfa5ff..f641a7f7 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -251,7 +251,6 @@ const Events = Module("events", { for (let [, evt_obj] in Iterator(events.fromString(keys))) { for (let type in values(["keydown", "keyup", "keypress"])) { - let elem = dactyl.focus || buffer.focusedFrame; let evt = this.feedingEvent = update({}, evt_obj, { type: type }); if (isObject(noremap)) diff --git a/common/content/io.js b/common/content/io.js index 83362f39..0bc2de62 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -265,7 +265,16 @@ lookup: let process = services.create("process"); process.init(file); - process.run(blocking, args.map(String), args.length); + process.run(false, args.map(String), args.length); + try { + if (blocking) + while (process.isRunning) + util.threadYield(false, true); + } + catch (e) { + process.kill(); + throw e; + } return process.exitValue; }, @@ -588,19 +597,20 @@ lookup: if (args.bang) arg = "!" + arg; - // replaceable bang and no previous command? - dactyl.assert(!/((^|[^\\])(\\\\)*)!/.test(arg) || io._lastRunCommand, - "E34: No previous command"); - // NOTE: Vim doesn't replace ! preceded by 2 or more backslashes and documents it - desirable? // pass through a raw bang when escaped or substitute the last command // This is an asinine and irritating feature when we have searchable // command-line history. --Kris - if (options["banghist"]) + if (options["banghist"]) { + // replaceable bang and no previous command? + dactyl.assert(!/((^|[^\\])(\\\\)*)!/.test(arg) || io._lastRunCommand, + "E34: No previous command"); + arg = arg.replace(/(\\)*!/g, function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand) ); + } io._lastRunCommand = arg; diff --git a/common/modules/base.jsm b/common/modules/base.jsm index 126ab13f..d3ce56ab 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -38,7 +38,10 @@ if (!Object.defineProperty) if ("value" in desc) if (desc.writable && !objproto.__lookupGetter__.call(obj, prop) && !objproto.__lookupSetter__.call(obj, prop)) - obj[prop] = value; + try { + obj[prop] = value; + } + catch (e if e instanceof TypeError) {} else { objproto.__defineGetter__.call(obj, prop, function () value); if (desc.writable)