kjs: variables with/without var [PATCH]
Harri Porten
porten at kde.org
Sun Jan 19 00:06:27 GMT 2003
On Sat, 18 Jan 2003, Maciej Stachowiak wrote:
> > Hmm, I'm afraid I don't see how putValue() could know the right
> > globalobject to use..... or is that
> > exec->context().imp()->variableObject() ?
>
> variableObject is not the nearest global object, it's the pseudo-object
> for the function's local scope. I'm pretty sure that without `var' you
> should be setting a global variable.
I agree. We just seem to have a problem chosing the right "global" space.
> The kjs in Safari (based on 3.0.x)
> is putting things in the global object in this case, and the original
> posted example works fine with the "var" removed, which makes me doubt
> there is anything wrong with the globalObject() call.
We had to change the "window" behaviour in order to fix
http://bugs.kde.org/show_bug.cgi?id=51120
With Window::hasProperty() always returning true you'll end up with
variables being found (and probably also placed) differently.
Harri.
More information about the kfm-devel
mailing list