Create shared data space for YUI instances #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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.