Skip to content

Instantly share code, notes, and snippets.

@TooTallNate
Created March 11, 2011 00:27
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 TooTallNate/865250 to your computer and use it in GitHub Desktop.
Save TooTallNate/865250 to your computer and use it in GitHub Desktop.
Cannot extend global prototypes in the REPL...
nrajlich@nathan-HP-Mini-311:~$ cat repl-fail.js
global.Object.prototype.test = true;
nrajlich@nathan-HP-Mini-311:~$ cat repl-test.js
require('./repl-fail');
console.log(typeof {}.test);
nrajlich@nathan-HP-Mini-311:~$ node repl-test.js
boolean
nrajlich@nathan-HP-Mini-311:~$ node
> require('./repl-fail')
{}
> console.log(typeof {}.test)
undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment