virtual-scope
A library for manipulating scopes without having to worry about conflicting names
Usage
; // Create a new top-level scope.const top = ; // Create two virtual scopes within the top scope.const a = top;const b = top; // Define names...a; // ... that appear within only the expected scopes.a; // trueb; // false b; b; assert; // true // With two virtual scopes both defining 'foo', we must// deconflict names within the the scope.top; // When we now lookup the actual names, we get:aname; // 'foo'bname; // '_foo' // The names that are used in the scope are, unsurprisingly:top; // [ '_foo', 'foo' ]