diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2013-01-16 22:10:06 -0500 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2013-01-16 22:15:03 -0500 |
commit | 813d1ddffe02a2a7fc92429b47ee15c7b6fde5ea (patch) | |
tree | 3afc80cb48bbe42b028d2822f0f04b7eefc7274f /src | |
parent | 1da93c212747b91da3927cbf1723de7b70680f1f (diff) |
library: Support external libraries that modify Array.prototype
While a somewhat-dangerous practice, existing users do do this,
and we shouldn't abort on it. Using hasOwnProperty is a simple
way to make sure we're checking the dense array itself, not the
prototype.
Diffstat (limited to 'src')
-rw-r--r-- | src/library.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js index 53ebbf15..0a8e862a 100644 --- a/src/library.js +++ b/src/library.js @@ -52,7 +52,7 @@ LibraryManager.library = { streams: [null], #if ASSERTIONS checkStreams: function() { - for (var i in FS.streams) assert(i >= 0 && i < FS.streams.length); // no keys not in dense span + for (var i in FS.streams) if (FS.streams.hasOwnProperty(i)) assert(i >= 0 && i < FS.streams.length); // no keys not in dense span for (var i = 0; i < FS.streams.length; i++) assert(typeof FS.streams[i] == 'object'); // no non-null holes in dense span }, #endif |