comparison psgxs.js @ 43:023f767662d3

Fix compatibility with strict mode of node 0.4 and some files without licence header.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 01 Mar 2011 11:58:15 +0100
parents 6697f394301f
children 3e0ca96d2dce
comparison
equal deleted inserted replaced
42:07ca0263a53f 43:023f767662d3
16 * GNU Affero General Public License for more details. 16 * GNU Affero General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Affero General Public License 18 * You should have received a copy of the GNU Affero General Public License
19 * along with PSĜS. If not, see <http://www.gnu.org/licenses/>. 19 * along with PSĜS. If not, see <http://www.gnu.org/licenses/>.
20 */ 20 */
21
22 'use strict';
21 23
22 var xmpp = require('xmpp'); 24 var xmpp = require('xmpp');
23 var sha1 = require('sha1'); 25 var sha1 = require('sha1');
24 require('./iso8601'); 26 require('./iso8601');
25 var storage = require('./storage'); 27 var storage = require('./storage');
43 conn.log = function (_, m) { console.log(m); }; 45 conn.log = function (_, m) { console.log(m); };
44 46
45 function _(obj, color) { 47 function _(obj, color) {
46 var str = require('sys').inspect(obj, false, null); 48 var str = require('sys').inspect(obj, false, null);
47 if (color) 49 if (color)
48 console.log('\033['+c+';1m' + str + '\033[0m'); 50 console.log('\x1b['+c+';1m' + str + '\x1b[0m');
49 else 51 else
50 console.log(str); 52 console.log(str);
51 }; 53 };
52 54
53 process.addListener('uncaughtException', function (err) { 55 process.addListener('uncaughtException', function (err) {
54 console.log('\033[41;1mUncaught exception (' + err + '), this should never happen:\033[0m\n' + err.stack); 56 console.log('\x1b[41;1mUncaught exception (' + err + '), this should never happen:\x1b[0m\n' + err.stack);
55 }); 57 });
56 58
57 if (typeof xmpp.StanzaBuilder.cnode != 'function' || typeof xmpp.StanzaBuilder.prototype.cnode != 'function') { 59 if (typeof xmpp.StanzaBuilder.cnode != 'function' || typeof xmpp.StanzaBuilder.prototype.cnode != 'function') {
58 xmpp.StanzaBuilder.prototype.cnode = function (stanza) 60 xmpp.StanzaBuilder.prototype.cnode = function (stanza)
59 { 61 {