[Webkit-unassigned] [Bug 17250] New: Array instanceof test fails when using iframes
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Feb 8 22:46:41 PST 2008
http://bugs.webkit.org/show_bug.cgi?id=17250
Summary: Array instanceof test fails when using iframes
Product: WebKit
Version: 523.x (Safari 3)
Platform: PC
OS/Version: Windows XP
Status: UNCONFIRMED
Severity: Major
Priority: P2
Component: JavaScriptCore
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: sanjiv.jivan+wk at gmail.com
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 and Opera
but fails on Safari only.
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>
--
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list