Created
September 21, 2012 14:01
-
-
Save subzey/3761624 to your computer and use it in GitHub Desktop.
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 foo = function(){ | |
| var o = {foo: 42}; | |
| global.bar = function(){ | |
| return o; | |
| }; | |
| try { | |
| return o; | |
| } finally { | |
| o = null; | |
| } | |
| }; | |
| console.log(foo()); // {foo: 42} | |
| console.log(bar()); // null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is that a bug or just fine with try ... finally statement?