Skip to content

Instantly share code, notes, and snippets.

@subzey
Created September 21, 2012 14:01
Show Gist options
  • Select an option

  • Save subzey/3761624 to your computer and use it in GitHub Desktop.

Select an option

Save subzey/3761624 to your computer and use it in GitHub Desktop.
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
@subzey
Copy link
Copy Markdown
Author

subzey commented Oct 3, 2012

@tsaniel, sorry for late comment. It's an expected behavior according to specs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment