Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Message from discussion bug in Safari? eval scope / context
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Eric Shulman  
View profile  
 More options Jan 5 2008, 10:06 am
From: Eric Shulman <elsdes...@gmail.com>
Date: Sat, 5 Jan 2008 07:06:15 -0800 (PST)
Local: Sat, Jan 5 2008 10:06 am
Subject: Re: bug in Safari? eval scope / context

> Changing the use of eval() is sound, although as a word of warning,
> I've found in the past that this is an area that's extremely hard to
> change without breaking existing plugins on some browser or another
> (sometimes quite subtly). In the past, we did at one point try a
> slightly different approach of something like:

> window.eval("function() {" + tiddler.text+ "}();");

> The idea was to better isolate plugins, and also to enable them to
> return an exit code via the 'return' statement. As I recall it, we had
> to pull the change quickly to accommodate one or the other of the
> clunkier browsers (probably Safari).

Actually, while the suggested change may seem innocuous, it will
create serious problems for existing plugins:

MANY bits of javascript code assume that something like this:
   myStateFlag = true;
creates a variable in the GLOBAL scope (i.e., window.myStateFlag).
This is typically used to track plugin-specific stateful information
that needs to PERSIST between invocations of their plugin code.

This usage could be corrected by re-writing each plugin so that
references to global variables always use an explicit "window." prefix
to specify the scope.  However, that would create a HUGE impact on
existing code, and would create a major schism between versions: any
plugins that rely on creating global values that are already installed
in existing documents would BREAK when migrating to the new core,
making upgrades a real headache for everyone, not just plugin
developers!

As the author (and maintainer) of nearly 160 plugins and scripts, the
impact on my code alone would be extremely distruptive and unless
there is a compelling reason to make this change, I strongly recommend
NOT doing it.

-e
Eric Shulman
TiddlyTools / ELS Design Studios


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.