Closed
Bug 444712
Opened 17 years ago
Closed 12 years ago
Error console reports bogus undefined error when accessing variables in another frame
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: skswbwt, Unassigned)
Details
(Keywords: testcase)
Attachments
(1 file)
560 bytes,
application/zip
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
Using Firefox 3, Error Console reports an object is undefined even though its properties could not accessed (the object is not undefined).
Tried in Firefox 2; problem didn't occur.
Reproducible: Always
Steps to Reproduce:
1. Create two frames, f1 and f2. Put in f1 a script with a global object variable, say ob. Assign some properties to ob, say color and name.
2. In f2, try to access a property of ob in f1 (parent.frames["f2"].ob.color), say alert(parent.frames["f2"].ob.color);
3. Error console will now raise an error saying parent.frames["f2"].ob is undefined, even though the object is defined (the alert box will display the right value of color).
Sample code:
In f1.html:
<html>
<head>
<script>
function Ob() {
this.color = "black";
this.name = "a";
}
var ob = new Ob();
</script>
</head>
<body>f1</body>
</html>
In f2.html:
<html>
<head>
<script>
alert(parent.frames["f1"].ob);
</script>
</head>
<body>f2</body>
</html>
Frame file:
<html>
<head></head>
<frameset row="*,*">
<frame src="f1.html"/>
<frame src="f2.html"/>
</frameset>
</html>
Actual Results:
Error Console reports an error.
Expected Results:
Error Console should not report an error.
Firebug is installed.
Reporter | ||
Updated•17 years ago
|
Version: unspecified → 3.0 Branch
Assignee | ||
Updated•17 years ago
|
Product: Firefox → Toolkit
Comment 1•12 years ago
|
||
current trunk...
Error: TypeError: parent.frames.f1 is undefined
Source File: file:///C:/Users/Wayne/Documents/Firefox/f2.html
Line: 4
Component: Error Console → General
Keywords: testcase
Product: Toolkit → Core
Summary: Error console reports bogus errors when accessing variables in another frame → Error console reports bogus undefined error when accessing variables in another frame
Comment 2•12 years ago
|
||
![]() |
||
Comment 3•12 years ago
|
||
I don't get it. That testcase never defines anything named "f1" anywhere, so parent.frames.f1 _is_ in fact undefined.
So as far as I can tell, this is invalid.
Please feel free to reopen if you can give me any reason at all there should be a property "f1" on the parent window!
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
![]() |
||
Comment 4•12 years ago
|
||
frames["f1"] and frames.f1 are IE specific behaviours.
http://www.w3.org/TR/Window/#notcovered
"This specification does not include the following features, which are also found on the
Window object in some implementations."
![]() |
||
Comment 5•12 years ago
|
||
> frames["f1"] and frames.f1 are IE specific behaviours.
No, they're not. And they're specced right here: http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#dom-window-nameditem
But the point is in the example here there is no frame with the name "f1".
You need to log in
before you can comment on or make changes to this bug.
Description
•