Skip to content

Instantly share code, notes, and snippets.

@aristidb
Created December 1, 2008 22:56
Show Gist options
  • Save aristidb/30882 to your computer and use it in GitHub Desktop.
Save aristidb/30882 to your computer and use it in GitHub Desktop.
Foo = {
// ...
}
this.load = 2
function Importer() {
// Pseudo-code, not actual implementation.
this.load = function load() {...};
this.context = {};
this.context.__proto__ = this.__proto__;
this.__proto__ = this.context;
}
var i = Importer();
i.load('foo');
assert(i.Foo);
i.load; // a function
i.context.load; // 2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment