Bug 20165

Summary: javascript function closures simply do not work.
Product: [Applications] konqueror Reporter: bug-kde-org
Component: kjsAssignee: Konqueror Developers <konq-bugs>
Status: CLOSED FIXED    
Severity: grave    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Other   
Latest Commit: Version Fixed In:

Description bug-kde-org 2001-02-09 16:20:04 UTC
(*** This bug was imported into bugs.kde.org ***)

Package: kjs
Version: 2.1 Beta 2
Severity: grave
Installed from: Source

The idiom that's failing is this:

function F () {
this.blah = function () { return 0; };
}

var fff = new F();

For an example see

http://tribble.ilrt.bris.ac.uk/~cmjg/test/functional

(you'll need to examine the source). Other examples (more extensive) at

http://tribble.ilrt.bris.ac.uk/~cmjg/logic/prolog-latest

(see these in a recent Netscape for comparison)


(submitted via bugs.kde.org)
Comment 1 Harri Porten 2001-03-08 22:11:39 UTC
> Package: kjs
> Version: 2.1 Beta 2
> Severity: grave
> Installed from: Source
> 
> The idiom that's failing is this:
> 
>         function F () {
>                 this.blah = function () { return 0; };
>         }
> 
>         var fff = new F();

Fixed now (probably already in KDE 2.1).
 
> For an example see
> 
> http://tribble.ilrt.bris.ac.uk/~cmjg/test/functional

Works.

> (you'll need to examine the source). Other examples (more extensive) at
> 
> http://tribble.ilrt.bris.ac.uk/~cmjg/logic/prolog-latest

An error message somewhere but I'm sorry to say that I don't feel like
debugging that complex piece of code. If you can extract the guilty part
feel free to file another report.

Thanks

Harri.