Created
October 29, 2014 09:49
-
-
Save Constellation/0d973073bae4c980598c 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
| object.forEachMethod = function(fn){ | |
| if (!methodsEnumerable) for (var i = 0, l = methods.length; i < l; i++){ | |
| fn.call(prototype, prototype[methods[i]], methods[i]); | |
| } | |
| for (var key in prototype) fn.call(prototype, prototype[key], key) | |
| }; | |
| // Listing non-enumerable methods here. But there's no "contains" before | |
| // https://github.com/mootools/mootools-core/commit/521471f5c0617edc12c680cdad8346c3eb95776a | |
| ...('Array', Array, [ | |
| 'pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift', 'concat', 'join', 'slice', | |
| 'indexOf', 'lastIndexOf', 'filter', 'forEach', 'every', 'map', 'some', 'reduce', 'reduceRight' | |
| ]) ... | |
| // Now, 'contains' is not enumerated. | |
| Array.forEachMethod(function(method, name){ | |
| Elements.implement(name, method); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment