mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
791 B
26 lines
791 B
var path = require("path");
|
|
|
|
exports.testDir = path.dirname(__filename);
|
|
exports.fixturesDir = path.join(exports.testDir, "fixtures");
|
|
exports.libDir = path.join(exports.testDir, "../lib");
|
|
exports.tmpDir = path.join(exports.testDir, "tmp");
|
|
exports.PORT = 12346;
|
|
|
|
exports.assert = require('assert');
|
|
|
|
var sys = require("sys");
|
|
for (var i in sys) exports[i] = sys[i];
|
|
//for (var i in exports) global[i] = exports[i];
|
|
|
|
function protoCtrChain (o) {
|
|
var result = [];
|
|
for (; o; o = o.__proto__) { result.push(o.constructor); }
|
|
return result.join();
|
|
}
|
|
|
|
exports.indirectInstanceOf = function (obj, cls) {
|
|
if (obj instanceof cls) { return true; }
|
|
var clsChain = protoCtrChain(cls.prototype);
|
|
var objChain = protoCtrChain(obj);
|
|
return objChain.slice(-clsChain.length) === clsChain;
|
|
};
|
|
|