Permalink
Browse files

Define required properties on the exemplar so they throw if not overi…

…dded.
  • Loading branch information...
Gozala committed Dec 20, 2011
1 parent 1a70cf6 commit 84211d6813aedb801dce23e7542e43b8c30b062e
Showing with 2 additions and 1 deletion.
  1. +2 −1 packages/api-utils/lib/protocol.js
@@ -101,6 +101,7 @@ const AbstractHandler = {
exports.AbstractHandler = AbstractHandler;
const AboutHandler = Factory.extend(AbstractHandler, {
+ get what() { throw Error('Property `what` is required') },
interfaces: [ 'nsIAboutModule' ],
get classDescription() 'Protocol handler for "about:' + this.scheme + '"',
get contractID() '@mozilla.org/network/protocol/about;1?what=' + this.scheme,
@@ -109,7 +110,7 @@ const AboutHandler = Factory.extend(AbstractHandler, {
exports.AboutHandler = AboutHandler;
const ProtocolHandler = Factory.extend(AbstractHandler, {
- onResolve: function onResolve() throw Error('Not implemented'),
+ onResolve: function onResolve() { throw Error('Not implemented') },
interfaces: [ 'nsIProtocolHandler' ],
get classDescription() 'Protocol handler for "' + this.scheme + ':*"',
get contractID() '@mozilla.org/network/protocol;1?name=' + this.scheme,

0 comments on commit 84211d6

Please sign in to comment.