Demonstrate that instanceof doesn't work for arrays created in another frame.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@12097 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -63,6 +63,20 @@
|
||||
"isArray reports new Array() is an Array");
|
||||
}
|
||||
|
||||
function test_iframe_isArray(t) {
|
||||
t.plan(3);
|
||||
// create an array in an iframe
|
||||
var iframe = document.createElement("iframe");
|
||||
document.body.appendChild(iframe);
|
||||
frames[frames.length-1].document.write(
|
||||
"<script>parent.testArray = [];<\/script>"
|
||||
);
|
||||
|
||||
t.ok(!!testArray, "testArray created");
|
||||
t.ok(!(testArray instanceof Array), "instanceof check doesn't work");
|
||||
t.eq(OpenLayers.Util.isArray(testArray), true, "isArray works");
|
||||
}
|
||||
|
||||
function test_$(t) {
|
||||
t.plan(1);
|
||||
t.ok($ === custom$, "OpenLayers doesn't clobber existing definition of $.");
|
||||
|
||||
Reference in New Issue
Block a user