From 419d9b61f853ad9287f4804726f5df475a950f78 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 19 Oct 2011 22:45:55 -0400 Subject: [PATCH] Simplifyification. --- common/content/abbreviations.js | 4 +++- common/content/mappings.js | 16 +++++++--------- common/modules/styles.jsm | 7 ++++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/common/content/abbreviations.js b/common/content/abbreviations.js index 71e6c93b..1cd08c87 100644 --- a/common/content/abbreviations.js +++ b/common/content/abbreviations.js @@ -350,7 +350,9 @@ var Abbreviations = Module("abbreviations", { command: this.name, arguments: [abbr.lhs], literalArg: abbr.rhs, - options: callable(abbr.rhs) ? {"-javascript": null} : {} + options: { + "-javascript": abbr.rhs ? null : undefined + } } for ([, abbr] in Iterator(abbreviations.user.merged)) if (abbr.modesEqual(modes)) diff --git a/common/content/mappings.js b/common/content/mappings.js index 935f06cf..7c40ea4e 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -625,15 +625,13 @@ var Mappings = Module("mappings", { .map(function (hive) [ { command: "map", - options: array([ - hive.name !== "user" && ["-group", hive.name], - map.count && ["-count"], - ["-modes", uniqueModes(map.modes)], - ["-description", map.description], - map.silent && ["-silent"]]) - - .filter(util.identity) - .toObject(), + options: { + "-count": map.count ? null : undefined, + "-description": map.description, + "-group": hive.name == "user" ? undefined : hive.name, + "-modes": uniqueModes(map.modes), + "-silent": map.silent ? null : undefined + }, arguments: [map.names[0]], literalArg: map.rhs, ignoreDefaults: true diff --git a/common/modules/styles.jsm b/common/modules/styles.jsm index 0d2fcb55..1f517aaf 100644 --- a/common/modules/styles.jsm +++ b/common/modules/styles.jsm @@ -628,9 +628,10 @@ var Styles = Module("Styles", { command: "style", arguments: [style.sites.join(",")], literalArg: style.css, - options: update( - hive.name == "user" ? {} : { "-group": hive.name }, - style.name ? { "-name": style.name } : {}) + options: { + "-group": hive.name == "user" ? undefined : hive.name, + "-name": style.name || undefined + } }))) .flatten().array });