From d7fbddd945560e457213a61458fa1fc13989d824 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 27 Jan 2011 22:17:34 -0500 Subject: [PATCH 1/7] Fix stupid error thrown on FF36 when trying to delete a nonexistent attribute from a DOM object. --- common/content/events.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/content/events.js b/common/content/events.js index 3b93df55..479898d7 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -992,7 +992,8 @@ var Events = Module("events", { */ input: function onInput(event) { - delete event.originalTarget.dactylKeyPress; + if (event.originalTarget.dactylKeyPress) + delete event.originalTarget.dactylKeyPress; }, // this keypress handler gets always called first, even if e.g. From e20133ae1fc3dab24dd7247a861b01f990713051 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 28 Jan 2011 01:49:05 -0500 Subject: [PATCH 2/7] Fix fallout from the merge SNAFU. --- common/content/dactyl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 3cbd1203..84082d1e 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1127,7 +1127,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { }); params = params || {}; - if (isArray(params)) + if (isString(params)) params = { where: params }; let flags = 0; From 0f6f7f161042fbba7e2436eb361321f954794c19 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 28 Jan 2011 05:12:42 -0500 Subject: [PATCH 3/7] Fix building with XPI=/absolute/path. --- common/Makefile | 4 ++-- common/make_jar.sh | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/common/Makefile b/common/Makefile index f2460f4e..9e7169e8 100644 --- a/common/Makefile +++ b/common/Makefile @@ -35,8 +35,8 @@ XPI_TEXTS = js jsm $(JAR_TEXTS) XPI_BINS = $(JAR_BINS) XPI_NAME = $(NAME)-$(VERSION) -XPI_PATH = ../downloads/$(XPI_NAME) -XPI = $(XPI_PATH).xpi +XPI_PATH = ../downloads/ +XPI = $(XPI_PATH)$(XPI_NAME).xpi RDF = ../downloads/update.rdf RDF_IN = $(RDF).in diff --git a/common/make_jar.sh b/common/make_jar.sh index 5e08f522..f12b5ee7 100644 --- a/common/make_jar.sh +++ b/common/make_jar.sh @@ -49,7 +49,13 @@ copytext() { ( echo "modified: $1"; diff -u -- "$1" "$2" | grep '^[-+][^-+]' ) } -[ -e "$top/$jar" ] && rm -rf "$top/$jar" +[ -f "$jar" ] && rm -f "$jar" +case "$jar" in + /*) ;; + *) + [ -d "$jar" ] && rm -rf "$jar" + jar="$top/$jar";; +esac for base in $bases do @@ -82,12 +88,12 @@ done set -e; cd $stage; case $jar in - (*/) if [ "$stage" != "$top/$jar" ]; then mv -- * $top/$jar; fi;; - (*) zip -9r "$top/$jar" -- *;; + (*/) if [ "$stage" != "$jar" ]; then mv -- * $jar; fi;; + (*) zip -9r "$jar" -- *;; esac ) || exit 1 -[ "$stage" != "$top/$jar" ] && rm -rf "$stage" +[ "$stage" != "$jar" ] && rm -rf "$stage" true # vim:se ft=sh sts=4 sw=4 et: From 9b3ec5b76bf662dd022e64e6115d3d463673f88c Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 28 Jan 2011 05:29:11 -0500 Subject: [PATCH 4/7] Make building an XPI with spaces in its name possible. --- common/Makefile | 7 +++---- common/make_jar.sh | 10 +++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/common/Makefile b/common/Makefile index 9e7169e8..2c263220 100644 --- a/common/Makefile +++ b/common/Makefile @@ -47,7 +47,7 @@ AWK ?= awk B64ENCODE ?= base64 CURL ?= curl -#.SILENT: +.SILENT: #### rules @@ -84,7 +84,6 @@ info: @echo "doc files $(DOC_FILES)" @echo "xpi files $(XPI_FILES)" -xpi: $(XPI) jar: $(JAR) release: $(XPI) $(RDF) @@ -169,7 +168,7 @@ test: $(XPI) #### xpi -$(XPI): $(CHROME) +xpi: $(CHROME) @echo "Building XPI..." mkdir -p $(XPI_PATH) @@ -179,7 +178,7 @@ $(XPI): $(CHROME) $(MAKE_JAR) "$(XPI)" "$(XPI_BASES)" "$(XPI_DIRS)" "$(XPI_TEXTS)" "$(XPI_BINS)" "$(XPI_FILES)" rm -r -- $(CHROME) - @echo "Built XPI: $@" + @echo "Built XPI: $XPI" #### jar diff --git a/common/make_jar.sh b/common/make_jar.sh index f12b5ee7..a84aad83 100644 --- a/common/make_jar.sh +++ b/common/make_jar.sh @@ -2,7 +2,7 @@ set -e fromrepo= -if [ $1 = -r ]; then shift; fromrepo=1; fi +if [ "$1" = -r ]; then shift; fromrepo=1; fi top=$(pwd) jar=$1 @@ -15,7 +15,7 @@ files="$@" HG=${HG:-hg} stage="$top/${jar%.*}" -mkdir -p $stage +mkdir -p "$stage" sed=$(which sed) if [ "xoo" = x$(echo foo | sed -E 's/f(o)/\1/' 2>/dev/null) ] @@ -86,9 +86,9 @@ done ( set -e; - cd $stage; - case $jar in - (*/) if [ "$stage" != "$jar" ]; then mv -- * $jar; fi;; + cd "$stage"; + case "$jar" in + (*/) if [ "$stage" != "$jar" ]; then mv -- * "$jar"; fi;; (*) zip -9r "$jar" -- *;; esac ) || exit 1 From d09220089243f23c2ef14d496f6669fe08fbbdb9 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 28 Jan 2011 05:41:33 -0500 Subject: [PATCH 5/7] Fix building with XPI=/absolute/path. --- common/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/Makefile b/common/Makefile index 2c263220..78ef6775 100644 --- a/common/Makefile +++ b/common/Makefile @@ -35,8 +35,8 @@ XPI_TEXTS = js jsm $(JAR_TEXTS) XPI_BINS = $(JAR_BINS) XPI_NAME = $(NAME)-$(VERSION) -XPI_PATH = ../downloads/ -XPI = $(XPI_PATH)$(XPI_NAME).xpi +XPI = ../downloads/$(XPI_NAME).xpi +XPI_PATH = $(TOP)$(XPI:%.xpi=%) RDF = ../downloads/update.rdf RDF_IN = $(RDF).in @@ -170,11 +170,11 @@ test: $(XPI) xpi: $(CHROME) @echo "Building XPI..." - mkdir -p $(XPI_PATH) + mkdir -p "$(XPI_PATH)" $(AWK) -v 'name=$(NAME)' -v 'suffix=$(MANGLE)' \ -f $(BASE)/process_manifest.awk \ - $(TOP)/chrome.manifest >$(XPI_PATH)/chrome.manifest + $(TOP)/chrome.manifest >"$(XPI_PATH)/chrome.manifest" $(MAKE_JAR) "$(XPI)" "$(XPI_BASES)" "$(XPI_DIRS)" "$(XPI_TEXTS)" "$(XPI_BINS)" "$(XPI_FILES)" rm -r -- $(CHROME) From 227fff2a049e5ad4e678dc9d73d88b0b32fd68b6 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 28 Jan 2011 06:02:03 -0500 Subject: [PATCH 6/7] Fix typo. --- common/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/Makefile b/common/Makefile index 78ef6775..846deb09 100644 --- a/common/Makefile +++ b/common/Makefile @@ -178,7 +178,7 @@ xpi: $(CHROME) $(MAKE_JAR) "$(XPI)" "$(XPI_BASES)" "$(XPI_DIRS)" "$(XPI_TEXTS)" "$(XPI_BINS)" "$(XPI_FILES)" rm -r -- $(CHROME) - @echo "Built XPI: $XPI" + @echo "Built XPI: $(XPI)" #### jar From 5cba6cbc773065bdc20cb7819f69e4e8550b041f Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 28 Jan 2011 10:10:10 -0500 Subject: [PATCH 7/7] Fix :dia completion. --- common/content/dactyl.js | 2 +- common/modules/base.jsm | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 84082d1e..76db2f82 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1642,7 +1642,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { bang: true, completer: function (context) { context.ignoreCase = true; - return completion.dialog(context); + completion.dialog(context); } }); diff --git a/common/modules/base.jsm b/common/modules/base.jsm index efdbd106..9e04c492 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -758,6 +758,7 @@ Class.memoize = function memoize(getter) this.get = function replace() let (obj = this.instance || this) ( Class.replaceProperty(obj, key, null), Class.replaceProperty(obj, key, getter.call(this, key))) + this.set = function replace(val) Class.replaceProperty(this.instance || this, val); } }); @@ -1246,6 +1247,9 @@ update(iter, { * given predicate. */ nth: function nth(iter, pred, n, self) { + if (typeof pred === "number") + [pred, n] = [function () true, pred]; // Hack. + for (let elem in iter) if (pred.call(self, elem) && n-- === 0) return elem;