Odd error in IE 7 with $.each

Odd error in IE 7 with $.each


$.each(document.styleSheets... fails with the error:
Line: 692
Character: 11
Code: 0
Error Message: Invalid procedure call or argument
The simplest page with the error is:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.2/jquery.js" ></script>
<script>
$.each (document.styleSheets, function(){});
</script>
(making the markup valid and adding a DOCTYPE don't help).
A regular for loop works fine.
It seems the problem is the object[++i] at the end of the loop;
instead of returning undefined it throws the error.
Danny