Created
April 4, 2011 08:03
-
-
Save xdenser/901273 to your computer and use it in GitHub Desktop.
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
console.log((new Error("test") instanceof Error)); | |
var ctx = {log: function(msg){console.log(msg);}}; | |
var vm = require('vm'); | |
vm.runInNewContext('function errtest(err){log(err instanceof Error);}; errtest(new Error("test 2"));',ctx); | |
vm.runInNewContext('errtest(new Error("test 3"));',ctx); | |
// outputs: | |
// true | |
// true | |
// false - WTF ?? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment