OSDN Git Service

substringDataメソッドreplaceDataメソッドの軽量化
authordhrname <dhrname@users.sourceforge.jp>
Tue, 3 Dec 2013 13:19:29 +0000 (22:19 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Tue, 3 Dec 2013 13:19:29 +0000 (22:19 +0900)
org/w3c/core.js

index 7578fcc..a78a926 100644 (file)
@@ -530,7 +530,7 @@ CharacterData.prototype = Object._create(Node);                    //ノード
    */\r
   /*string*/ cproto.substringData = function(/*long*/ offset, /*long*/ count) {\r
     if (offset < 0 || count < 0 || offset > this.length) { //値が負か、データの長さよりoffsetが長いとき、サイズエラーを起こす\r
-      throw (new DOMException(/*INDEX_SIZE_ERR*/ 1));\r
+      throw new DOMException(/*INDEX_SIZE_ERR*/ 1);\r
     }\r
     if (offset + count > this.length) {                    //offsetとcountの和が文字全体の長さを超える場合、offsetから最後までのを取り出す\r
       count = this.length - offset;\r
@@ -559,7 +559,7 @@ CharacterData.prototype = Object._create(Node);                    //ノード
   };\r
   /*void*/ cproto.replaceData = function( /*long*/ offset, /*long*/ count, /*string*/ arg) {\r
     if (offset < 0 || count < 0 || offset > this.length) { //値が負か、データの長さよりoffsetが長いとき、サイズエラーを起こす\r
-      throw (new DOMException(/*INDEX_SIZE_ERR*/ 1));\r
+      throw new DOMException(/*INDEX_SIZE_ERR*/ 1);\r
     }\r
     this.deleteData(offset, count);\r
     this.insertData(offset, arg);\r