OSDN Git Service

Fix a item method of the childNodes property
authordhrname <dhrname@users.sourceforge.jp>
Mon, 30 Jul 2012 12:34:04 +0000 (21:34 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Mon, 30 Jul 2012 12:34:04 +0000 (21:34 +0900)
org/w3c/core.js

index c870da7..a540f24 100644 (file)
@@ -399,6 +399,9 @@ Node.prototype = {
 
 
 Array.prototype.item = function( /*long*/ index) {
+  if (!this[index]) {
+    return null;
+  }
   return (this[index]);
 };
 /*ノードリストはArrayで代用。