Bug 51120 - with() statement leads to wrong variable object being used (testcase)
Summary: with() statement leads to wrong variable object being used (testcase)
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: kjs (show other bugs)
Version: 4.0
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-24 10:52 UTC by Alastair Scott
Modified: 2003-09-30 15:04 UTC (History)
0 users

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 Alastair Scott 2002-11-24 10:52:15 UTC
Version:           4.0 (using KDE 3.0.9)
Compiler:          gcc version 3.2 (Mandrake Linux 9.1 3.2-3mdk)
OS:          Linux (i686) release 2.4.19-16mdk

http://www.uib.no/people/pfvaf/chesslib/Java/HTML/Petrosian/petrosian.htm

All similar pages (available from http://www.uib.no/people/pfvaf/chesslib/Java.htm) trigger exactly the same problem - the LH frame loading quickly and correctly, the RH frame sticking at 'Loading game ...' and then a popup appearing stating that the Javascript on this page (frame?) is causing Konquerer to freeze.
Comment 1 David Faure 2002-11-29 12:41:06 UTC
I see no "freezing" anymore, with KDE-3.1-final, but the images on the chessboard are 
not set (their src is set to undefined). 
 
Here's a testcase for this problem. 
51120-frameset.html contains: 
 
<frameset> 
  <frame src="51120.html"> 
</frameset> 
 
and 51120.html contains: 
<html> 
<script> 
var diagram = top; 
function setboard(){ 
  var bild; 
  with(diagram){ 
        // Should set our own var "bild", not a property of "diagram" 
        // (the with() clause was used for other things in this block) 
        bild="hello world"; 
  } 
  alert(bild); 
} 
setboard(); 
</script> 
</html> 
 
The issue is how a with() statement affects the "variable object", the one variables get 
put into. I'm not sure what the spec says about this. Harri? 
Comment 2 Harri Porten 2002-12-24 22:47:43 UTC
Fixed (the test case at least) in the HEAD branch. Affected files object.cpp and
kjs_window.cpp.

Port back to 3.1 branch ?
Comment 3 Harri Porten 2003-09-30 15:04:45 UTC
*** Bug has been marked as fixed ***.