Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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