You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2011/09/27 12:06:29 UTC

svn commit: r1176305 - /myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js

Author: werpu
Date: Tue Sep 27 10:06:29 2011
New Revision: 1176305

URL: http://svn.apache.org/viewvc?rev=1176305&view=rev
Log:
https://issues.apache.org/jira/browse/MYFACES-3333


Modified:
    myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js

Modified: myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js?rev=1176305&r1=1176304&r2=1176305&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js (original)
+++ myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js Tue Sep 27 10:06:29 2011
@@ -851,6 +851,13 @@ myfaces._impl.core._Runtime.singletonExt
      * @param deepScan if set to true a deep scan is performed otherwise a shallow scan
      */
     findByTagNames: function(fragment, tagNames, deepScan) {
+        if(!fragment) {
+            throw Error(this._Lang.getMessage("ERR_MUST_BE_PROVIDED1",null, "myfaces._impl._util._Dom.findByTagNames", "fragment"));
+        }
+        if(!tagNames) {
+            throw Error(this._Lang.getMessage("ERR_MUST_BE_PROVIDED1",null, "myfaces._impl._util._Dom.findByTagNames", "tagNames"));
+        }
+
         var nodeType = fragment.nodeType;
         if(nodeType != 1 && nodeType != 9 && nodeType != 11) return null;
 
@@ -905,6 +912,13 @@ myfaces._impl.core._Runtime.singletonExt
      *
      */
     findByTagName : function(fragment, tagName, deepScan) {
+        if(!fragment) {
+            throw Error(this._Lang.getMessage("ERR_MUST_BE_PROVIDED1",null, "myfaces._impl._util._Dom.findByTagName", "fragment"));
+        }
+        if(!tagName) {
+            throw Error(this._Lang.getMessage("ERR_MUST_BE_PROVIDED1",null, "myfaces._impl._util._Dom.findByTagName", "tagName"));
+        }
+
         var nodeType = fragment.nodeType;
         if(nodeType != 1 && nodeType != 9 && nodeType != 11) return null;
 
@@ -944,6 +958,14 @@ myfaces._impl.core._Runtime.singletonExt
     ,
 
     findByName : function(fragment, name, deepScan) {
+        if(!fragment) {
+            throw Error(this._Lang.getMessage("ERR_MUST_BE_PROVIDED1",null, "myfaces._impl._util._Dom.findByName", "fragment"));
+        }
+        if(!name) {
+            throw Error(this._Lang.getMessage("ERR_MUST_BE_PROVIDED1",null, "myfaces._impl._util._Dom.findByName", "name"));
+        }
+
+
         var nodeType = fragment.nodeType;
         if(nodeType != 1 && nodeType != 9 && nodeType != 11) return null;