Rewand
21 Jun 2007, 1:02 PM
Using version 1.0.1a, tested with prototype and yui adapters.
I'm finding that new Array's are not empty. They contain a function called remove. This seems to be introduced by the adapter classes. Note this example.
<html>
<head>
<script type='text/javascript' src='/ext/adapter/prototype/ext-prototype-adapter.js'>
</script>
</head>
<body onload="testArray();">
<div id="mydiv"></div>
</body>
</html>
<script>
function testArray(){
var a = new Array();
a.push("dummy element");
var s = "";
for(var i in a){
s += (typeof(a[i]) + "<br>");
}
document.getElementById("mydiv").innerHTML = s;
}
</script>
With the adapter included the results are
string
function
With the adapter not included the results are
string
Is this a known issue? Is there a fix?
I'm finding that new Array's are not empty. They contain a function called remove. This seems to be introduced by the adapter classes. Note this example.
<html>
<head>
<script type='text/javascript' src='/ext/adapter/prototype/ext-prototype-adapter.js'>
</script>
</head>
<body onload="testArray();">
<div id="mydiv"></div>
</body>
</html>
<script>
function testArray(){
var a = new Array();
a.push("dummy element");
var s = "";
for(var i in a){
s += (typeof(a[i]) + "<br>");
}
document.getElementById("mydiv").innerHTML = s;
}
</script>
With the adapter included the results are
string
function
With the adapter not included the results are
string
Is this a known issue? Is there a fix?