This file contains hidden or 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
| //From http://wiki.ecmascript.org/doku.php?id=harmony:proxies | |
| function handlerMaker(obj) { | |
| return { | |
| getOwnPropertyDescriptor: function(name) { | |
| var desc = Object.getOwnPropertyDescriptor(obj, name); | |
| // a trapping proxy's properties must always be configurable | |
| if (desc !== undefined) { desc.configurable = true; } | |
| return desc; | |
| }, | |
| getPropertyDescriptor: function(name) { |
This file contains hidden or 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
| // Flow is a construct that can chain together functions. | |
| // Flow denotes regular function composition. | |
| var chain1 = | |
| Flow <- f1 | |
| <- f2 | |
| <- f3 | |
| chain1(123) // same as f3(f2(f1(123))) | |
| // Can also chain together multiple things that go to one. |
This file contains hidden or 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
| var optimist = require('optimist') | |
| optimist.demand('color') | |
| optimist.demand('size') | |
| optimist.argv |
OlderNewer