Created
January 15, 2016 13:59
-
-
Save meixg/553a453f3b5cdab52072 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
| //一个创建宏命令的函数 | |
| var MacroCommand = function(){ | |
| return { | |
| commandsList : [], | |
| add : function(command){ | |
| this.commandsList.push(command); | |
| }, | |
| execute: function(){ | |
| for(var i = 0, command; command = this.commandsList[i++];){ | |
| command.execute(); | |
| } | |
| } | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment