1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 15:27:57 +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

@@ -437,12 +437,10 @@ var Buffer = Module("buffer", {
yield elems[i];
}
// <link>s have higher priority than normal <a> hrefs
let elems = frame.document.getElementsByTagName("link");
for (let elem in iter(elems))
yield elem;
// no links? ok, look for hrefs
elems = frame.document.getElementsByTagName("a");
for (let elem in iter(elems))
yield elem;

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,

View File

@@ -607,11 +607,13 @@ var tests = {
init: this.runtime.init,
cleanup: this.runtime.cleanup,
noOutput: [
"! .pentadactyl/some-nonexistent/really-nonexistent.js",
".pentadactyl/some-nonexistent/good.css",
".pentadactyl/some-nonexistent/good.js",
".pentadactyl/some-nonexistent/good.penta"
],
error: [
".pentadactyl/some-nonexistent/really-nonexistent.js",
"~/.pentadactyl/some-nonexistent/bad.js",
"~/.pentadactyl/some-nonexistent/bad.penta",
"./.pentadactyl/some-nonexistent/bad.js",