add extendNative() to repr extension

This commit is contained in:
Sami Samhuri 2011-06-05 18:11:34 -07:00
parent 930225c297
commit 7ec9d3f296

View file

@ -4,6 +4,10 @@
// readable string representations of values
exports.repr = repr;
exports.extendNative = function() {
global.repr = repr;
};
function repr(x) {
if (x !== null && x !== undefined && typeof x.repr === 'function') return x.repr();
@ -43,4 +47,4 @@ function repr(x) {
}
throw new Error("don't know how to represent " + x);
};
}