Closed
Bug 645130
Opened 14 years ago
Closed 14 years ago
instanceof Array test fails when using iframes
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 631135
People
(Reporter: matthew.lieder, Unassigned)
Details
(Keywords: regression)
Attachments
(2 files)
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)
Build Identifier: 4.0
(this is copied from https://bugs.webkit.org/show_bug.cgi?id=17250; it was fine in Firefox 3 but now is failing in Firefox 4)
I have an iframe where I'm creating an Array with in the parent's context via new parent.Array(). I now call a function in the parent window passing this array. When the parent function receives this argument, it fails the instanceof test.
I understand that passing "new Array()" from the iframe to parent will cause the "instanceof Array " test to fail in the parent because the contexts of the two are different, but in this case I am creating a array from the parent context itself yet if fails the "instanceof Array" test. Below is a simple testcase illustrating the problem. This test runs fine on IE, Firefox up to 3.x and Opera but fails on Firefox 4 and Safari.
parent.html
<html>
<head>
</head>
<body>
<script type="text/javascript">
function isArray(arr) {
alert(arr instanceof Array);
}
</script>
</body>
<iframe src="child.html"></iframe>
</html>
child.html
<html>
<head>
</head>
<body>
<script type="text/javascript">
function test() {
var arr = new parent.Array();
parent.isArray(arr);
}
</script>
<button onclick="test()">Array Test</button>
</body>
</html>
Reproducible: Always
Reporter | ||
Updated•14 years ago
|
Version: unspecified → 4.0 Branch
Updated•14 years ago
|
Assignee: nobody → general
Component: General → JavaScript Engine
Keywords: regression,
regressionwindow-wanted
Product: Firefox → Core
QA Contact: general → general
Version: 4.0 Branch → Trunk
![]() |
||
Comment 1•14 years ago
|
||
Comment 2•14 years ago
|
||
This is a known problem that I tried to fix for 4 but couldn't get working in time for release. I really need to circle back around to it now. :-\
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
![]() |
||
Comment 3•14 years ago
|
||
Updated•14 years ago
|
Keywords: regressionwindow-wanted
You need to log in
before you can comment on or make changes to this bug.
Description
•