It's an interesting implementation; would need some cleanup, IMHO.
The things I see off-hand are:

1. window.__INCLUDE_TEST_2__ is never deleted if it's successfully

2. _insertScriptTag is defined on "this" and then left there, but not
reused if it exists.  I don't see that it needs to be defined on
"this" as opposed to referencing it with a local variable, unless it's
going to be retained and reused -- in which case I wouldn't create it
within the function anyawy.

3. Would be useful if the return value were false in the case where
none of the methods worked (even though you haven't found any engines
where it doesn't yet).
T.J. Crowder
tj / crowder software / com

On Mar 24, 3:14 am, kangax <[EMAIL PROTECTED]> wrote:
> I actually really like the solution in one of the comments on Dean's
> "sandbox.eval" post [1]. It does no browser sniffing and degrades
> nicely to "script insertion" on browsers which don't support
>, ... ) and execScript. The "check" for eval can be
> done when prototye loads - this should not affect performance - and
> produce a boolean indicating whether eval works or not. I'm still
> confused whether we should sacrifice code size for "no-browser-
> sniffing". What do you think?
> [1]
> - kangax
> On Mar 23, 10:30 am, John-David Dalton <[EMAIL PROTECTED]>
> wrote:
> > I don't have an issue with Prototype.exec(),
> > I choose exec rather than Prototype.eval (because issues with browsers
> > that reserve the word eval for only the real eval method only), it is
> > shorter than Prototype.globalEval(), its not negatively associated
> > with eval() <evil>, and  eval isn't used once in the method.
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at

Reply via email to