All pastes #510391 Raw Edit

Mine

public text v1 · immutable
·published 2007-05-25 21:45 UTC
rendered paste body
[scriptable, uuid(5678d4a3-2543-4ece-afbb-079292f2866e)]
interface calIServer : nsISupports
{
    attribute AString host; 

    attribute PRUint32 port; 
    
    attribute AUTF8String status;
}
[scriptable, uuid(d1d2e05d-5472-482e-b0a4-a9e43925d530)]
interface nsIFoo : nsISupports
{
     readonly attribute calIServer server;

};


implementation:

foo.prototype = {

    get server() { 
        if (!this.mServer) { 
            this.mServer = Components.classes['...'].createInstance(Ci.nsIServer);
        } 
        this.mServer.port = 80; 
        this.mServer.host = "foobar.com"; 
        this.mServer.status = "Offline" 
    } 
}

server.prototype = {
    host: null,
    port: 0,
    status: null
};

var foo = Cc[...].getService(Ci.nsIFoo);

dump(foo.server.port);
foo.server.port = 443;