test to track exported symbols in dygraph-combined.js
authorDan Vanderkam <danvdk@gmail.com>
Sun, 21 Jul 2013 15:17:17 +0000 (11:17 -0400)
committerDan Vanderkam <danvdk@gmail.com>
Sun, 21 Jul 2013 15:17:17 +0000 (11:17 -0400)
tests/exported-symbols.html [new file with mode: 0644]

diff --git a/tests/exported-symbols.html b/tests/exported-symbols.html
new file mode 100644 (file)
index 0000000..8b9e32d
--- /dev/null
@@ -0,0 +1,61 @@
+<!doctype html>
+<html>
+  <head>
+    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
+    <title>Exported Symbols test</title>
+    <!--[if IE]>
+    <script type="text/javascript" src="../excanvas.js"></script>
+    <![endif]-->
+  </head>
+  <body>
+    <p>dygraphs exports these symbols into the global namespace:</p>
+    <ol id="list">
+    </ol>
+
+    <p>It exports these symbols inside each of those symbols:</p>
+    <ol id="list2">
+    </ol>
+
+    <script type="text/javascript">
+      var windowProps = {};
+      var newProps = [];
+      var k, i, html, level2props, sym, topSymbol;
+      for (k in window) {
+        windowProps[k] = true;
+      }
+    </script>
+    <!--
+    <script type="text/javascript" src="../dygraph-dev.js"></script>
+    -->
+    <script type="text/javascript" src="../dygraph-combined.js"></script>
+    <script type="text/javascript">
+      for (k in window) {
+        if (!windowProps.hasOwnProperty(k)) {
+          newProps.push(k);
+        }
+      }
+      newProps.sort();
+      html = '';
+      for (i = 0; i < newProps.length; i++) {
+        html += '<li>' + newProps[i] + '</li>\n';
+      }
+      document.getElementById('list').innerHTML = html;
+
+      level2props = [];
+      for (i = 0; i < newProps.length; i++) {
+        topSymbol = newProps[i];
+        for (k in window[topSymbol]) {
+          sym = topSymbol + '.' + k;
+          level2props.push(sym);
+        }
+      }
+
+      newProps.sort();
+      html = '';
+      for (i = 0; i < level2props.length; i++) {
+        html += '<li>' + level2props[i] + '</li>\n';
+      }
+      document.getElementById('list2').innerHTML = html;
+    </script>
+  </body>
+</html>