Created
March 18, 2011 05:33
-
-
Save davidascher/875659 to your computer and use it in GitHub Desktop.
test case for irc q about runInThisContext
This file contains 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 x = 'test'; | |
var vm = require('vm'); | |
console.log('in test.js'); | |
var test = "console.log('in test.vm'); console.log('x = ', x);"; | |
vm.runInThisContext(test, 'test.vm'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This throws an exception because x isn't available in "this" context.