Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/830569 to your computer and use it in GitHub Desktop.
Save isaacs/830569 to your computer and use it in GitHub Desktop.
From c5b0e760fcaeae1968c9f637b0ec89d15698634d Mon Sep 17 00:00:00 2001
From: isaacs <i@izs.me>
Date: Wed, 16 Feb 2011 15:40:53 -0800
Subject: [PATCH] Closes GH-232 Make the repl's global the right thing
---
lib/repl.js | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/repl.js b/lib/repl.js
index 8ae6028..66eb96d 100644
--- a/lib/repl.js
+++ b/lib/repl.js
@@ -45,6 +45,8 @@ function resetContext() {
for (var i in global) context[i] = global[i];
context.module = module;
context.require = require;
+ context.global = context;
+ context.global.global = context;
for (var i in require.cache) delete require.cache[i];
}
--
1.7.2.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment