1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-14 14:55:51 +01:00

Don't print error message on :source! non-existent-file. Add tests. Closes issue #390.

This commit is contained in:
Kris Maglione
2011-02-18 20:20:36 -05:00
parent 54452917b2
commit 11c39de46b
3 changed files with 6 additions and 4 deletions

View File

@@ -147,7 +147,9 @@ var IO = Module("io", {
source: function source(filename, params) {
const { contexts } = modules;
defineModule.loadLog.push("sourcing " + filename);
params = params || {};
if (!isObject(params))
params = { silent: params };
let time = Date.now();
return contexts.withContext(null, function () {
@@ -793,7 +795,7 @@ unlet s:cpo_save
if (args.length > 1)
dactyl.echoerr("E172: Only one file name allowed");
else
io.source(args[0], args.bang);
io.source(args[0], { silent: args.bang });
}, {
argCount: "+", // FIXME: should be "1" but kludged for proper error message
bang: true,