mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 19:17:59 +01:00
Don't print error message on :source! non-existent-file. Add tests. Closes issue #390.
This commit is contained in:
@@ -437,12 +437,10 @@ var Buffer = Module("buffer", {
|
|||||||
yield elems[i];
|
yield elems[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
// <link>s have higher priority than normal <a> hrefs
|
|
||||||
let elems = frame.document.getElementsByTagName("link");
|
let elems = frame.document.getElementsByTagName("link");
|
||||||
for (let elem in iter(elems))
|
for (let elem in iter(elems))
|
||||||
yield elem;
|
yield elem;
|
||||||
|
|
||||||
// no links? ok, look for hrefs
|
|
||||||
elems = frame.document.getElementsByTagName("a");
|
elems = frame.document.getElementsByTagName("a");
|
||||||
for (let elem in iter(elems))
|
for (let elem in iter(elems))
|
||||||
yield elem;
|
yield elem;
|
||||||
|
|||||||
@@ -147,7 +147,9 @@ var IO = Module("io", {
|
|||||||
source: function source(filename, params) {
|
source: function source(filename, params) {
|
||||||
const { contexts } = modules;
|
const { contexts } = modules;
|
||||||
defineModule.loadLog.push("sourcing " + filename);
|
defineModule.loadLog.push("sourcing " + filename);
|
||||||
params = params || {};
|
|
||||||
|
if (!isObject(params))
|
||||||
|
params = { silent: params };
|
||||||
|
|
||||||
let time = Date.now();
|
let time = Date.now();
|
||||||
return contexts.withContext(null, function () {
|
return contexts.withContext(null, function () {
|
||||||
@@ -793,7 +795,7 @@ unlet s:cpo_save
|
|||||||
if (args.length > 1)
|
if (args.length > 1)
|
||||||
dactyl.echoerr("E172: Only one file name allowed");
|
dactyl.echoerr("E172: Only one file name allowed");
|
||||||
else
|
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
|
argCount: "+", // FIXME: should be "1" but kludged for proper error message
|
||||||
bang: true,
|
bang: true,
|
||||||
|
|||||||
@@ -607,11 +607,13 @@ var tests = {
|
|||||||
init: this.runtime.init,
|
init: this.runtime.init,
|
||||||
cleanup: this.runtime.cleanup,
|
cleanup: this.runtime.cleanup,
|
||||||
noOutput: [
|
noOutput: [
|
||||||
|
"! .pentadactyl/some-nonexistent/really-nonexistent.js",
|
||||||
".pentadactyl/some-nonexistent/good.css",
|
".pentadactyl/some-nonexistent/good.css",
|
||||||
".pentadactyl/some-nonexistent/good.js",
|
".pentadactyl/some-nonexistent/good.js",
|
||||||
".pentadactyl/some-nonexistent/good.penta"
|
".pentadactyl/some-nonexistent/good.penta"
|
||||||
],
|
],
|
||||||
error: [
|
error: [
|
||||||
|
".pentadactyl/some-nonexistent/really-nonexistent.js",
|
||||||
"~/.pentadactyl/some-nonexistent/bad.js",
|
"~/.pentadactyl/some-nonexistent/bad.js",
|
||||||
"~/.pentadactyl/some-nonexistent/bad.penta",
|
"~/.pentadactyl/some-nonexistent/bad.penta",
|
||||||
"./.pentadactyl/some-nonexistent/bad.js",
|
"./.pentadactyl/some-nonexistent/bad.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user