Created
December 19, 2011 22:46
-
-
Save Saneyan/1499260 to your computer and use it in GitHub Desktop.
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
| /** | |
| * Auto Update | |
| * These anonymous functions extends specific object automatically. | |
| */ | |
| (function( Update ){ | |
| try{ | |
| // Succeed to wic properties and methods. | |
| // But some of them are overridden. | |
| Update.prototype = wic; | |
| } catch( e ){ | |
| // For undefined object 'wic' | |
| Update.prototype = {}; | |
| } | |
| // Set as a new object. | |
| wic = new Update(); | |
| }) | |
| /** | |
| * Constructor. | |
| */ | |
| (function(){ | |
| this.say = function(){ | |
| alert( 'Hello, world!' ); | |
| }; | |
| }); | |
| wic.say(); // Hello, world! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment