Bug 71506 - [test case] instanceof operator fails for variables in other windows
Summary: [test case] instanceof operator fails for variables in other windows
Status: RESOLVED WORKSFORME
Alias: None
Product: konqueror
Classification: Applications
Component: kjs (show other bugs)
Version: unspecified
Platform: RedHat Enterprise Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 72812 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-12-30 17:26 UTC by Morten Wang
Modified: 2012-06-20 08:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Morten Wang 2003-12-30 17:26:02 UTC
Version:            (using KDE KDE 3.1)
Installed from:    RedHat RPMs
OS:          Linux

Testcase is found on http://www.kakeboksen.org/javascript/tester/instanceof-number/frameset.html  Konqueror fails on testcase #1 and #2 once the window reference points to any other window (child window, parent frameset, etc).

The instanceof operator works correctly for variables in the same window (as testcase #3 shows), and I expected this behaviour to happen also when going between windows. I haven't dug really deeply into the ECMA-262 reference to know exactly how it's expected to behave, but from my understanding of the spec it should work in all cases (Mozilla 1.5 does it this way).
Comment 1 Harri Porten 2004-02-23 11:48:32 UTC
My guess (without even trying out anything): we have to share built-in types like Array between all interpreter instances. I even recall some changes to that part of the code in JavaScriptCore.
Comment 2 Stephan Kulow 2004-10-15 17:54:28 UTC
possibly related: #72812
Comment 3 Harri Porten 2005-02-27 14:32:11 UTC
*** Bug 72812 has been marked as a duplicate of this bug. ***
Comment 4 Miguel De Anda 2007-11-10 01:52:58 UTC
If you have a page (test.html) with a framed page in it (test2.html) the instanceof operator in the framed page no longer works.

=== test.html 
<html>
 <head>
  <script>
   window.onload = function() {
    window.frames.test2.testInstanceOf();
   }
  </script>
 </head>
 <body>
  <iframe src="test2.html" name="test2"></iframe>
 </body>
</html>

=== test2.html
<html>
 <head>
  <script>
   function testInstanceOf() {
    alert(([] instanceof Array) + "\n" + (new Date() instanceof Date));
   }
   
   if (window == top)
    testInstanceOf();
    
  </script>
 </head>
 <body>
  test 2
 </body>
</html>
Comment 5 Miguel De Anda 2007-11-10 01:54:01 UTC
btw. that was using kde 3.5.7.
Comment 6 Maksim Orlovich 2008-04-08 02:14:24 UTC
c#4 passes in 4.0.x. The testcase in #1 does what I expect it to do, and what IceWeasel does as well, but not what the testcase seems to be expecting...
Comment 7 Myriam Schweingruber 2012-06-20 08:59:37 UTC
Closing based on comment #6