smugmug/yui3 — pull request #2 by lsmith (2012-12-20 08:34:22+00:00)
Title: Create shared data space for YUI instances

Y.shared = { an object that all instances share };

Move YUI.Env.globalEvents (aka, Y.Global) to Y.shared.globalEventTarget

Also cleaned up the YUI constructor and yui.js file formatting a bit. Scary, I know. The diff for yui.js is hard to determine the changes from. For the most part, I moved the YUI constructor definition inside the IIFE so it could access the new shared object without exposing it on the prototype or on the YUI object. This resulted in a bunch of indent changes. The constructor itself had some unnecessary conditionals like

```
if (!l) { Y._setup(); }
if (l) { Y._setup(); }
```

The various test suites I've run have passed. The net change of this PR should be that Y.Global is no longer available from outside a YUI sandbox and there is now a private sharing space between YUI instances.