Created
March 4, 2011 01:47
-
-
Save fkei/854019 to your computer and use it in GitHub Desktop.
Array type check
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
--- lib/log4js.js.orig 2011-03-04 10:32:06.000000000 +0900 | |
+++ lib/log4js.js 2011-03-04 10:42:24.000000000 +0900 | |
@@ -134,8 +134,8 @@ | |
args = [ ALL_CATEGORIES ]; | |
} | |
//argument may already be an array | |
- if (args[0].forEach) { | |
- args = args[0]; | |
+ if (args[0].constructor.name === 'Array') { | |
+ args = args[0]; | |
} | |
args.forEach(function(category) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I learned a better check on Twitter.
if (Array.isArray(args[0]) {