michael@0: /* vim:set ts=2 sw=2 sts=2 et cin: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); michael@0: michael@0: function SimpleTest() { michael@0: } michael@0: michael@0: SimpleTest.prototype = { michael@0: classID: Components.ID("{4177e257-a0dc-49b9-a774-522a000a49fa}"), michael@0: michael@0: QueryInterface: function(iid) { michael@0: if (iid.equals(Components.interfaces.nsISimpleTest) || michael@0: iid.equals(Components.interfaces.nsISupports)) michael@0: return this; michael@0: throw Components.results.NS_ERROR_NO_INTERFACE; michael@0: }, michael@0: michael@0: add: function(a, b) { michael@0: dump("add(" + a + "," + b + ") from JS\n"); michael@0: return a + b; michael@0: } michael@0: }; michael@0: michael@0: this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SimpleTest]);