Skip to content

Instantly share code, notes, and snippets.

@cgrand

cgrand/scope.md

Last active Sep 6, 2017
Embed
What would you like to do?
Introspectable js scope
// assuming b is a local
// rewrite
function(a) { return a + b; }
// to
Object.defineProperty(function(a) { return a + b; }, "$scope", {value: function() { return {"b": b}; }})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment