Skip to content

Commit 45556bd

Browse files
committed
Expose Command constructor
The semantics of `const` has been changed in Firefox 44. https://blog.mozilla.org/addons/2015/10/14/breaking-changes-let-const-firefox-nightly-44/ This patch allows user-defined sub-commands in Firefix 44+. ```js commands.addUserCommand(['mycommand'], 'My command', function() {}, { subCommands: [ new Command(['sub'], 'My sub-command', function() { doSomething(); }), ], }); ```
1 parent a06afad commit 45556bd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

common/content/commands.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,8 @@ const Commands = Module("commands", {
11871187
});
11881188

11891189
(function () {
1190+
/* Expose Command constructor for user-defined sub-commands. */
1191+
Object.defineProperty(this, "Command", { value: Command });
11901192

11911193
Commands.quoteMap = {
11921194
"\n": "n",

0 commit comments

Comments
 (0)