From 8b5841587f06cc0e6b7e9031d01f13d646a83709 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sat, 5 Nov 2011 16:08:00 -0700 Subject: [PATCH] accept a context in extendNative() methods --- lib/range.js | 4 ++-- lib/repr.js | 4 ++-- lib/set.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/range.js b/lib/range.js index 7539a28..9ed9074 100644 --- a/lib/range.js +++ b/lib/range.js @@ -3,8 +3,8 @@ exports.Range = Range; -exports.extendNative = function() { - global.Range = Range; +exports.extendNative = function(context) { + context.Range = Range; }; function Range(start, length) { diff --git a/lib/repr.js b/lib/repr.js index a022e36..e852ad5 100644 --- a/lib/repr.js +++ b/lib/repr.js @@ -4,8 +4,8 @@ // readable string representations of values exports.repr = repr; -exports.extendNative = function() { - global.repr = repr; +exports.extendNative = function(context) { + context.repr = repr; }; function repr(x) { diff --git a/lib/set.js b/lib/set.js index d72159d..3ebfaa1 100644 --- a/lib/set.js +++ b/lib/set.js @@ -3,8 +3,8 @@ exports.Set = Set; -exports.extendNative = function() { - global.Set = Set; +exports.extendNative = function(context) { + context.Set = Set; }; var ownProps = Object.getOwnPropertyNames;