[Sie-announce] SIEコード [2669] addEventListenerメソッドの最適化

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 5月 10日 (火) 23:01:27 JST


Revision: 2669
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2669
Author:   dhrname
Date:     2011-05-10 23:01:27 +0900 (Tue, 10 May 2011)

Log Message:
-----------
addEventListenerメソッドの最適化

Modified Paths:
--------------
    branches/07x/077/org/w3c/dom/events.js

Modified: branches/07x/077/org/w3c/dom/events.js
===================================================================
--- branches/07x/077/org/w3c/dom/events.js	2011-05-08 11:42:59 UTC (rev 2668)
+++ branches/07x/077/org/w3c/dom/events.js	2011-05-10 14:01:27 UTC (rev 2669)
@@ -113,7 +113,7 @@
   var s = new EventListener(useCapture, type, listener), //リスナーを作成
       t = type.charAt(0),
       that;
-  this._capter[this._capter.length] = s;                 //このノードにリスナーを登録しておく
+  this._capter.push(s);                 //このノードにリスナーを登録しておく
   if ((t !== "D") && (t !== "S") && (type !== "beginEvent") && (type !== "endEvent") && (type !== "repeatEvent")) { //MouseEventsならば
     that = this;
     that._tar && that._tar.attachEvent("on" +type, (function(node) { 
@@ -161,8 +161,8 @@
     } else if ((etime - td._limit_time_) > 1000) {
       /*1秒を超えたらバッファにため込んで後で使う*/
       tob = td.implementation._buffer_ || [];
-      tob[tob.length] = this;
-      tob[tob.length] = evt;
+      tob.push(this);
+      tob.push(evt);
       td.implementation._buffer_ = tob;
       return true;
     }




Sie-announce メーリングリストの案内
Back to archive index