WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
37935
[Qt] JavaScript global variables get re-initialized with each function call.
https://bugs.webkit.org/show_bug.cgi?id=37935
Summary
[Qt] JavaScript global variables get re-initialized with each function call.
nokiabugz
Reported
2010-04-21 11:00:39 PDT
When an external JavaScript file is included in an HTML file’s markup, any global variables that are defined get set back to their original values. For example: var myCounter = 0; function incrementCounter() { return ++myCounter; } Each time the incrementCounter function is called, the myCounter variable gets reset to zero, so the function always returns 1. This does NOT appear to happen with a small script such as the example above. The test case that is included DOES reproduce the error; it is unclear whether this is due to the amount of memory used, or the use of the httpRequest object, or something else entirely. (The enclosed test loads a canned website into an iframe, waits 10 seconds, then loads the next site from a list in sites.js. Some debug output is displayed in the textarea above the iframe.) This is reproducable on the week 14 QtWebKit build.
Attachments
test case
(272.79 KB, application/x-zip-compressed)
2010-04-22 05:55 PDT
,
nokiabugz
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2010-04-21 19:10:44 PDT
There is no test attached to this bug.
nokiabugz
Comment 2
2010-04-22 05:55:15 PDT
Created
attachment 54054
[details]
test case
Alexey Proskuryakov
Comment 3
2010-04-22 11:33:06 PDT
This test does not work in Firefox at all, so I can't compare results to Safari. What are expected results, and how do they differ from actual results?
Laszlo Gombos
Comment 4
2010-04-22 11:38:43 PDT
The unexpected output is if "ERROR: serverURL must be set before calling postResults" is posted as a serverResponse. I tried Safari 4.0.4 on Windows and QtLauncher on Linux and could not reproduce the problem. Marked the issue for Qt and Symbian only for now.
Janne Koskinen
Comment 5
2010-05-19 03:37:51 PDT
>This is reproducable on the week 14 QtWebKit build.
Samuel has been trying to reproduce this without any success of reproduction. Can you be more specific on the environment ? emulator or HW? Sounds like real nasty bug but if it only can be reproduced in emulator environment I'd put this to low priority or ignore it completely. WINSCW environment is not the most trustworthy thing when webkit gets to eat all address space. Laszlo is the broken JIT in W14? that could be source of this.
Balazs Kelemen
Comment 6
2010-06-03 05:20:27 PDT
It would be useful to try this with the interpreter (build-webkit --makeargs="-DENABLE_JIT=0").
Janne Koskinen
Comment 7
2010-11-25 00:51:45 PST
Can someone actually reproduce this? To test this you need to modify sites.js unless running this with webserver.
Janne Koskinen
Comment 8
2011-03-03 05:37:19 PST
Closing as no further info has been provided. Please re-open if issue is still valid and provide more specific instructions how to run the test set.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug