1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 05:58:03 +01:00

Add some editor assertions.

This commit is contained in:
Kris Maglione
2011-10-04 08:20:45 -04:00
parent a69eedc980
commit 9881403ddb

View File

@@ -409,6 +409,7 @@ var Editor = Module("editor", {
if (!(node instanceof Ci.nsIDOMText)) {
node = iterator[forward ? "getNext" : "getPrev"]();
dactyl.assert(node);
range[forward ? "setEnd" : "setStart"](node, forward ? 0 : node.textContent.length);
}
@@ -553,6 +554,7 @@ var Editor = Module("editor", {
function clear(forward, re)
function _clear(editor) {
updateRange(editor, forward, re, function (range) {});
dactyl.assert(!editor.selection.isCollapsed);
editor.selection.deleteFromDocument();
let parent = DOM(editor.rootElement.parentNode);
if (parent.isInput)