1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-28 00:03:32 +01:00

Add util.weakReference that won't crash if you pass null.

This commit is contained in:
Kris Maglione
2011-10-01 23:02:00 -04:00
parent c9583ac72f
commit 84a68bff9a
12 changed files with 25 additions and 15 deletions

View File

@@ -339,10 +339,10 @@ var RangeFinder = Module("rangefinder", {
*/
var RangeFind = Class("RangeFind", {
init: function init(window, content, matchCase, backward, elementPath, regexp) {
this.window = Cu.getWeakReference(window);
this.window = util.weakReference(window);
this.content = content;
this.baseDocument = Cu.getWeakReference(this.content.document);
this.baseDocument = util.weakReference(this.content.document);
this.elementPath = elementPath || null;
this.reverse = Boolean(backward);
@@ -381,7 +381,7 @@ var RangeFind = Class("RangeFind", {
this.range.selectionController.scrollSelectionIntoView(
this.range.selectionController.SELECTION_NORMAL, 0, false);
this.store.focusedFrame = Cu.getWeakReference(range.startContainer.ownerDocument.defaultView);
this.store.focusedFrame = util.weakReference(range.startContainer.ownerDocument.defaultView);
},
cancel: function cancel() {