JSArrayParser: Add JSJSONArrayParser as new (and preferred) method to parse JSON
[videosite.git] / videosite / JSArrayParser.pm
index 8f9b729..37452fe 100644 (file)
@@ -22,7 +22,17 @@ sub new {
     }
 
     # Try to find a child object which is available and return that.
-    #
+
+    # See if videosite::JSJSONArrayParser is available
+    eval {
+        require videosite::JSJSONArrayParser;
+    };
+
+    unless($@) {
+        # Available. Return a JSJSONArrayParser object
+        return videosite::JSJSONArrayParser->new(%params);
+    }
+
     # See if videosite::JSLexArrayParser is available
     eval {
         require videosite::JSLexArrayParser;