Created
October 8, 2014 23:41
-
-
Save Qard/6ecd272079d144854a9a to your computer and use it in GitHub Desktop.
I am a monster.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Emitter = require('events').EventEmitter | |
var evil = new Emitter | |
evil.on('foo', function (get) { | |
console.log('privateThing is', get('privateThing')) | |
}) | |
function foo () { | |
var privateThing = 'secret' | |
evil.emit('foo', function (prop) { | |
return eval(prop) | |
}) | |
} | |
foo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment