Re: script object property contamination [reckon I've sussed it
Re: script object property contamination [reckon I've sussed it
- Subject: Re: script object property contamination [reckon I've sussed it
- From: has <email@hidden>
- Date: Mon, 11 Feb 2002 23:01:46 +0000
Nigel Garvey wrote:
>
has's theory is born out by the fact that if you insert a 'property bob :
>
"Bob"' before frank in scriptOne, "Bob" is what's returned by TEST 2.
Actually, this is exactly the direction I approached the problem in the
first place...;)
I looked at how AS was behaving, then made an intelligent guess at the
underlying mechanism based on what little I know of 'real programming'
(really just A-level stuff) and how I would design it myself. I daresay one
of the AS team could confirm or deny my little theory for sure, but it
seems to fit with the physical evidence so far.
>
Whether you'd call this a bug (something unexpected at first glance), or
>
the natural result of transposing a handler compiled in one script into
>
another script, is a moot point.
This behaviour is NOT what would be expected under the circumstances[1],
therefore it's a bug. The system's traded off some security to get as much
speed as possible. Whether this possibility was anticipated and dismissed
as being sufficiently unlikely that it wasn't worth dealing with, or simply
wasn't considered at all, I don't know. I doubt it'll get fixed (I'm not
sure I'd consider it worth fixing), but it's one for the Big Hall of
Obscure Gotchas at any rate.
Cheers,
has
[1] i.e. What you'd expect is an error of form: 'can't find property bob in
scriptOne'. (Which is what you get if dynamic scoping is invoked through
use of the 'my' keyword, of course.)
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.