1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 09:37:58 +01:00

Get rid of silly stack dumps.

This commit is contained in:
Kris Maglione
2011-02-02 18:07:33 -05:00
parent 6de8120d57
commit 311a07fbd0
2 changed files with 65 additions and 12 deletions

View File

@@ -1257,8 +1257,6 @@ var CommandLine = Module("commandline", {
this.wildIndex++; this.wildIndex++;
this.preview(); this.preview();
modes.dumpStack();
util.dumpStack();
if (this.selected == null) if (this.selected == null)
statusline.progress = ""; statusline.progress = "";
else else

View File

@@ -19,6 +19,7 @@ var teardownModule = function (module) {
dactyl.teardown(); dactyl.teardown();
} }
function hasNItems(nItems) function (context) context.allItems.items.length == nItems;
function hasItems(context) context.allItems.items.length; function hasItems(context) context.allItems.items.length;
function hasntNullItems(context) hasItems(context) && function hasntNullItems(context) hasItems(context) &&
!context.allItems.items.some(function ({ text, description }) [text, description].some(function (text) /^\[object/.test(text))); !context.allItems.items.some(function ({ text, description }) [text, description].some(function (text) /^\[object/.test(text)));
@@ -455,9 +456,9 @@ var tests = {
], ],
singleOutput: ["some-nonexistent-file.js"], singleOutput: ["some-nonexistent-file.js"],
completions: [ completions: [
"", ["", hasItems],
"plugins/", ["some-nonexistent/", hasItems],
"info/" ["info/", hasItems]
] ]
}, },
sanitize: { sanitize: {
@@ -503,13 +504,67 @@ var tests = {
], ],
completions: [["", hasItems]] completions: [["", hasItems]]
}, },
source: {}, get source() ({
stop: {}, init: this.runtime.init,
stopall: {}, cleanup: this.runtime.cleanup,
style: {}, noOutput: [
styledisable: {}, ".pentadactyl/some-nonexistent/good.css",
styleenable: {}, ".pentadactyl/some-nonexistent/good.js",
styletoggle: {}, ".pentadactyl/some-nonexistent/good.penta"
],
errors: [
"~/.pentadactyl/some-nonexistent/bad.js",
"~/.pentadactyl/some-nonexistent/bad.penta",
"./.pentadactyl/some-nonexistent/bad.js",
"./.pentadactyl/some-nonexistent/bad.penta",
".pentadactyl/some-nonexistent/bad.js",
".pentadactyl/some-nonexistent/bad.penta"
],
singleOutput: [".pentadactyl/some-nonexistent-file.js"],
completions: this.runtime.completions
}),
stop: { noOutput: [""] },
stopall: { noOutput: [""] },
style: {
cleanup: ["delstyle -n foo"],
noOutput: [
"-name=foo http://does.not.exist/* div { display: inline; }",
"-name=foo -append http://does.not.exist/* span { display: block; }"
],
multiOutput: [
"",
"-name=foo"
],
completions: [
["", hasItems],
["-name=", hasItems],
["http:* div { -moz", hasItems],
["http:* div { foo: bar; -moz", hasItems],
["http:* div { foo: bar; } span { -moz", hasItems],
["http:* div { foo: bar; } span { foo: bar; -moz", hasItems]
]
},
styledisable: {
init: ["style -n foo http:* div {}", "style -n bar ftp:* div", "styledisable -n bar"],
cleanup: ["delstyle -n foo", "delstyle -n bar"],
noOutput: ["-name=foo"],
completions: [
["", hasItems],
["-name=", hasNItems(1)],
["-index=", hasNItems(1)]
]
},
get styleenable() this.styledisable,
styletoggle: {
init: ["style -n foo http:* div {}", "style -n bar ftp:* div", "styledisable -n bar"],
cleanup: ["delstyle -n foo", "delstyle -n bar"],
noOutput: ["-name=foo"],
completions: [
["", hasItems],
["-name=", hasNItems(2)],
["-index=", hasNItems(2)]
]
},
tab: {}, tab: {},
tabattach: {}, tabattach: {},
tabdetach: {}, tabdetach: {},