From 7ec9d3f2965dfd4092a3bb0814dc12aadda9b3fb Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sun, 5 Jun 2011 18:11:34 -0700 Subject: [PATCH] add extendNative() to repr extension --- lib/repr.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -}; +}