plasma.include() and member visibility

J Janz jj at juniorjanz.net
Sat Jan 16 14:22:30 CET 2010


2010/1/15 Aaron J. Seigo <aseigo at kde.org>

>
> it is a scoping problem. declaring "var name" means that the 'name'
> variable
> is local to that context (the file in this case).


Well, it's true. That's actually how JS works, so, not using var would be
the way to go. I, however, don't see how it would work for functions without
assigning them to variables or the plasmoid.

>
> to me it sounds
> like a problem waiting to happen:
>

Yes, it is. It could could completely mess up with any computing you might
be doing (it's not really hard to be using the same var names in an included
file and inside a function somewhere else) and also, as you exemplified,
final results. I suppose it was not well thought at the time of that
writing. Maybe that should get fixed instead of this (so, please don't patch
it).

That's what I suggest.

Cheers,
--
J (|´:¬{)»
---------------------------------------------
"Eu sou a ressurreição e a vida. Quem crê em mim, ainda que morra, viverá; e
todo o que vive e crê em mim não morrerá, eternamente. Crês isto?"
O Senhor, Jesus Cristo - Jo.11:25-26
---------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20100116/c36ac826/attachment.htm 


More information about the Plasma-devel mailing list