+2006-09-17 Eric Seidel <eric@eseidel.com>
+
+ Reviewed by hyatt.
+
+ * fast/js/window-properties.html: make work in Firefox (hangs IE)
+
2006-09-17 Eric Seidel <eric@eseidel.com>
Add a textual dump of the window object property tree.
+<html>
+<body>
<div id="log"></div>
<script type="text/javascript">
}
function havePrintedChildren(fullPropertyName, propertyValue) {
- var childrenPrintedUnderName = propertyValue._childrenPrintedUnderName;
- if (!childrenPrintedUnderName)
- propertyValue._childrenPrintedUnderName = fullPropertyName;
- return childrenPrintedUnderName;
+ try {
+ var childrenPrintedUnderName = propertyValue._childrenPrintedUnderName;
+ if (!childrenPrintedUnderName)
+ propertyValue._childrenPrintedUnderName = fullPropertyName;
+ return childrenPrintedUnderName;
+ } catch (e) {
+ log(fullPropertyName + " : ERROR determining if we have already printed children, assuming true");
+ return true;
+ }
}
function printProperties(object, parentString) {
for (propertyName in object) {
var fullPropertyName = parentString + '.' + propertyName;
- var propertyValue = object[propertyName];
+ var propertyValue;
+ try {
+ propertyValue = object[propertyName]; // Firefox throws here for certain unimplemented DOM3 properties
+ } catch (e) {
+ log(fullPropertyName + " : ERROR accessing property, exception thrown: " + e);
+ continue;
+ }
if (shouldSkipProperty(fullPropertyName, propertyValue))
continue;
var type = typeof(propertyValue);
printProperties(window, 'window');
</script>
+</body>
+</html>