Created
December 1, 2008 22:56
-
-
Save aristidb/30882 to your computer and use it in GitHub Desktop.
This file contains 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
Foo = { | |
// ... | |
} | |
this.load = 2 |
This file contains 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
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