[jQuery] bug when using Object.prototype ?

[jQuery] bug when using Object.prototype ?

Hi everyone,
If I attach a function to Object.prototype outside the
$(document).ready function, it gets executed when I load the page, is
this a bug?
Example:
<html>
<head>
<%@ include file="/jquery/jquery-1.0.1.js" %>
<meta http-equiv="content-type" content="text/html" />
</head>
<body>
<script type="text/javascript">
Object.prototype.foo = function(){
alert('foo');
};
</script>
</body>
</html>
I get the alert as soon as the page gets loaded, if I move it inside a
$(document).ready function, everything is fine then.
Carlos
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/