1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-26 21:25:45 +01:00

Deal with recent horrible TraceMonkey quirks.

This commit is contained in:
Kris Maglione
2011-02-14 00:27:12 -05:00
parent b296f36d1d
commit d09d5c7e41

View File

@@ -10,6 +10,8 @@ defineModule("finder", {
use: ["services", "util"] use: ["services", "util"]
}, this); }, this);
function equals(a, b) XPCNativeWrapper(a) == XPCNativeWrapper(b);
/** @instance rangefinder */ /** @instance rangefinder */
var RangeFinder = Module("rangefinder", { var RangeFinder = Module("rangefinder", {
Local: function (dactyl, modules, window) ({ Local: function (dactyl, modules, window) ({
@@ -37,7 +39,7 @@ var RangeFinder = Module("rangefinder", {
this.commandline; this.commandline;
this.CommandMode(mode).open(); this.CommandMode(mode).open();
if (this.rangeFind && this.rangeFind.window.get() === this.window) if (this.rangeFind && equals(this.rangeFind.window.get(), this.window))
this.rangeFind.reset(); this.rangeFind.reset();
this.find("", mode === this.modes.FIND_BACKWARD); this.find("", mode === this.modes.FIND_BACKWARD);
}, },
@@ -71,7 +73,7 @@ var RangeFinder = Module("rangefinder", {
// It's possible, with :tabdetach for instance, for the rangeFind to // It's possible, with :tabdetach for instance, for the rangeFind to
// actually move from one window to another, which breaks things. // actually move from one window to another, which breaks things.
if (!this.rangeFind if (!this.rangeFind
|| this.rangeFind.window.get() !== this.window || !equals(this.rangeFind.window.get(), this.window)
|| linksOnly != !!this.rangeFind.elementPath || linksOnly != !!this.rangeFind.elementPath
|| regexp != this.rangeFind.regexp || regexp != this.rangeFind.regexp
|| matchCase != this.rangeFind.matchCase || matchCase != this.rangeFind.matchCase
@@ -667,7 +669,7 @@ var RangeFind = Class("RangeFind", {
this.initialSelection = this.selection.getRangeAt(0); this.initialSelection = this.selection.getRangeAt(0);
}, },
descroll: function (range) { descroll: function () {
this.window.scrollTo(this.scroll.x, this.scroll.y); this.window.scrollTo(this.scroll.x, this.scroll.y);
}, },