Skip to content

Instantly share code, notes, and snippets.

@bpierre
Created July 8, 2011 18:09
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 bpierre/1072408 to your computer and use it in GitHub Desktop.
Save bpierre/1072408 to your computer and use it in GitHub Desktop.
Error.prepareStackTrace = function(error, structuredStackTrace) {
console.log('ok.');
};
// Simple test, ok
try {
console.log('simple test\u2026');
i_dont_exist();
} catch(e) {
var access_stack = e.stack;
}
// With vm.Script.runInNewContext(), dont work
var Script = require('vm').Script;
try {
console.log('runInNewContext\u2026');
Script.runInNewContext('i_dont_exist();', {});
} catch(e) {
var access_stack = e.stack;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment