diff --git a/lib/repr.js b/lib/repr.js index c6f6d97..a022e36 100644 --- a/lib/repr.js +++ b/lib/repr.js @@ -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); -}; +}