Skip to content
Browse files

Reverted previous commits.

  • Loading branch information...
1 parent bc177ac commit dae59cdcc1b90075eaf691598ec28e4ed1669fce @solmsted committed Dec 9, 2012
View
1 src/yui/README.md
@@ -22,7 +22,6 @@ sandbox system, plus utilities), and the following optional submodules:
* `get`: Provides dynamic loading of JavaScript and CSS
* `yui-log`: Adds support for `Y.log()` and friends.
* `yui-later`: An abstraction around `setTimeout` and `setInterval`.
- * `yui-soon`: An abstraction around `setImmediate` and `setTimeout`.
* `intl-base`: Provides dynamic loading of language packs.
`yui-core` contains:
View
31 src/yui/build.json
@@ -40,16 +40,6 @@
"yui-later.js"
]
},
- "yui-soon": {
- "jsfiles": [
- "yui-soon.js"
- ]
- },
- "yui-soon-nodejs": {
- "jsfiles": [
- "yui-soon-nodejs.js"
- ]
- },
"yui-core": {
"name": "yui-base",
"replace": {
@@ -73,16 +63,15 @@
"basefilename": "yui-base",
"name": "yui-base",
"replace": {
- "@YUI_CORE@": "['get', 'features', 'intl-base', 'yui-log', 'yui-later', 'yui-soon']"
+ "@YUI_CORE@": "['get', 'features', 'intl-base', 'yui-log', 'yui-later']"
},
"config": {
"use": [
"get",
"features",
"intl-base",
"yui-log",
- "yui-later",
- "yui-soon"
+ "yui-later"
]
},
"prependfiles": [
@@ -103,7 +92,7 @@
"basefilename": "yui-nodejs",
"name": "yui-base",
"replace": {
- "@YUI_CORE@": "['get', 'features', 'intl-base', 'yui-log', 'yui-log-nodejs', 'yui-later', 'yui-soon-nodejs', 'loader-base', 'loader-rollup', 'loader-yui3']"
+ "@YUI_CORE@": "['get', 'features', 'intl-base', 'yui-log', 'yui-log-nodejs', 'yui-later', 'loader-base', 'loader-rollup', 'loader-yui3']"
},
"config": {
"use": [
@@ -114,7 +103,6 @@
"yui-log",
"yui-log-nodejs",
"yui-later",
- "yui-soon-nodejs",
"loader-base",
"loader-rollup",
"loader-yui3"
@@ -138,7 +126,7 @@
"basefilename": "yui",
"name": "yui-base",
"replace": {
- "@YUI_CORE@": "['get', 'features', 'intl-base', 'yui-log', 'yui-later', 'yui-soon', 'loader-base', 'loader-rollup', 'loader-yui3']"
+ "@YUI_CORE@": "['get', 'features', 'intl-base', 'yui-log', 'yui-later', 'loader-base', 'loader-rollup', 'loader-yui3']"
},
"config": {
"use": [
@@ -148,7 +136,6 @@
"intl-base",
"yui-log",
"yui-later",
- "yui-soon",
"loader-base",
"loader-rollup",
"loader-yui3"
@@ -179,8 +166,7 @@
"features",
"intl-base",
"yui-log",
- "yui-later",
- "yui-soon"
+ "yui-later"
]
},
"files": [
@@ -189,8 +175,7 @@
"features",
"intl-base",
"yui-log",
- "yui-later",
- "yui-soon"
+ "yui-later"
]
},
"yui-nodejs": {
@@ -204,7 +189,6 @@
"yui-log",
"yui-log-nodejs",
"yui-later",
- "yui-soon-nodejs",
"loader-base",
"loader-rollup",
"loader-yui3"
@@ -218,7 +202,6 @@
"yui-log",
"yui-log-nodejs",
"yui-later",
- "yui-soon-nodejs",
"loader-base",
"loader-rollup",
"loader-yui3"
@@ -233,7 +216,6 @@
"intl-base",
"yui-log",
"yui-later",
- "yui-soon",
"loader-base",
"loader-rollup",
"loader-yui3"
@@ -246,7 +228,6 @@
"intl-base",
"yui-log",
"yui-later",
- "yui-soon",
"loader-base",
"loader-rollup",
"loader-yui3"
View
6 src/yui/docs/partials/modules.mustache
@@ -1215,10 +1215,6 @@
<td>Provides console log capability and exposes a custom event for</td>
</tr>
<tr>
- <td>`yui-soon`</td>
- <td>Provides a setImmediate/setTimeout wrapper. This module is a `core` YUI module, <a href="../classes/YUI.html#method_soon">its documentation is located under the YUI class</a>.</td>
- </tr>
- <tr>
<td>`yui-throttle`</td>
<td>Throttles a call to a method based on the time between calls. This method is attached</td>
</tr>
@@ -1227,4 +1223,4 @@
<td>YUI 3 module metadata</td>
</tr>
</tbody>
-</table>
+</table>
View
32 src/yui/js/yui-soon-nodejs.js
@@ -1,32 +0,0 @@
-/**
- * Provides a process.nextTick wrapper. This module is a `core` YUI module,
- * <a href="../classes/YUI.html#method_soon">its documentation is located under
- * the YUI class</a>.
- *
- * @module yui
- * @submodule yui-soon-nodejs
- * @author Steven Olmsted
- */
-
-// This module is a simplified version of yui-soon designed for Node.js. Refer
-// to yui-soon for more documentation.
-var soon = function (callbackFunction) {
- var canceled;
-
- soon._asynchronizer(function () {
- if (!canceled) {
- callbackFunction();
- }
- }, 0);
-
- return {
- cancel: function () {
- canceled = 1;
- }
- };
-};
-
-soon._asynchronizer = process.nextTick;
-soon._impl = 'nextTick';
-
-Y.soon = soon;
View
153 src/yui/js/yui-soon.js
@@ -1,153 +0,0 @@
-/**
- * Provides a setImmediate/setTimeout wrapper. This module is a `core` YUI
- * module, <a href="../classes/YUI.html#method_soon">its documentation is
- * located under the YUI class</a>.
- *
- * @module yui
- * @submodule yui-soon
- * @author Steven Olmsted
- */
-
-/**
- * Y.soon accepts a callback function. The callback function will be
- * called once in a future turn of the JavaScript event loop. If the
- * function requires a specific execution context or arguments, wrap it
- * with Y.bind. Y.soon returns an object with a cancel method. If the
- * cancel method is called before the callback function, the callback
- * function won't be called.
- * @method soon
- * @for YUI
- * @param {Function} callbackFunction
- * @return {Object} An object with a cancel method. If the cancel method is
- * called before the callback function, the callback function won't be called.
- */
-var soon = function (callbackFunction) {
- var canceled;
-
- soon._asynchronizer(function () {
- // Some asynchronizers may provide their own cancellation methods
- // such as clearImmediate or clearTimeout but some asynchronizers
- // do not. For simplicity, cancellation is entirely handled here
- // rather than wrapping the other methods. All asynchronizers are
- // expected to always call this anonymous function.
- if (!canceled) {
- callbackFunction();
- }
- });
-
- return {
- cancel: function () {
- canceled = 1;
- }
- };
- },
-
- subscribedToMessageEvent,
-
- // This is one possible asynchronizer implementation. It makes use of the
- // postMessage API which always receives messages in a future turn of the
- // JavaScript event loop.
- // This implementation is based on setImmediate.js.
- // https://github.com/NobleJS/setImmediate
- // Copyright (c) 2011 Barnesandnoble.com, llc and Donavon West
- // https://github.com/NobleJS/setImmediate/blob/master/MIT-LICENSE.txt
- postMessageAsynchronizer = function (callbackFunction) {
- if (!subscribedToMessageEvent) {
- // Subscribe to the message event.
- YUI.Env.add(Y.config.win, 'message', function (event) {
- // Only pay attention to messages from this window.
- if (event.source === Y.config.win) {
- // The message we've received in event.data could be
- // anything. If it's a Y.soon message id, there will be a
- // callback function associated with it.
- var id = event.data,
- originId = id + 'origin',
-
- callbackFunction = soon._asynchronizer[id];
-
- // Make sure we have a callbackFunction and that the event
- // and callbackFunction have matching origins.
- if (callbackFunction && event.origin === soon._asynchronizer[originId]) {
- // There is a valid callback function, so call it.
- callbackFunction();
-
- // We no longer need to keep the callback function.
- delete soon._asynchronizer[id];
- // We no longer need to keep the origin.
- delete soon._asynchronizer[originId];
-
- // Other listeners should't care about this message.
- if (event.stopImmediatePropagation) {
- event.stopImmediatePropagation();
- } else {
- event.stopPropagation();
- }
-
- event.preventDefault();
- }
- }
- }, false);
-
- subscribedToMessageEvent = true;
- }
-
- // Create a unique Y.soon message id for this callback function.
- var id = Y.guid('soon'),
-
- // Determine the current origin.
- location = Y.getLocation(),
- origin = location.origin || (location.protocol + '//' + location.host);
-
- // Store the callback function to be called later by the event handler.
- soon._asynchronizer[id] = callbackFunction;
- // Store the origin to be checked later by the event handler.
- soon._asynchronizer[id + 'origin'] = origin;
-
- // Send the message, but make sure it does not get sent to listeners
- // from another origin.
- Y.config.win.postMessage(id, origin);
- };
-
-/**
- * The asynchronizer is the internal mechanism which will call a function
- * asynchronously. This property is exposed as a convenient way to define a
- * different asynchronizer implementation without having to rewrite the entire
- * Y.soon interface.
- * @method _asynchronizer
- * @for soon
- * @param {Function} callbackFunction The function to call asynchronously.
- * @protected
- */
-
-/**
-* Since Y.soon is likely to have many differing asynchronizer implementations,
-* this property should be set to identify which implementation is in use.
-* @property _impl
-* @protected
-* @type String
-*/
-
-// Check for a native or already polyfilled implementation of setImmediate.
-if ('setImmediate' in Y.config.win) {
- soon._asynchronizer = function (callbackFunction) {
- Y.config.win.setImmediate(callbackFunction);
- };
- soon._impl = 'setImmediate';
-}
-
-// Check for postMessage but make sure we're not in a WebWorker.
-else if (('postMessage' in Y.config.win) && !('importScripts' in Y.config.win)) {
- soon._asynchronizer = postMessageAsynchronizer;
- soon._impl = 'postMessage';
-}
-
-// The most widely supported asynchronizer is setTimeout so we use that as the
-// fallback.
-else {
- soon._asynchronizer = function (callbackFunction) {
- setTimeout(callbackFunction, 0);
- };
- soon._impl = 'setTimeout';
-}
-
-Y.soon = soon;
View
2 src/yui/js/yui.js
@@ -1515,7 +1515,7 @@ overwriting other scripts configs.
*
* @property core
* @type Array
- * @default [ get, features, intl-base, yui-log, yui-later, yui-soon, loader-base, loader-rollup, loader-yui3 ]
+ * @default [ get,features,intl-base,yui-log,yui-later,loader-base, loader-rollup, loader-yui3 ]
*/
/**
View
6 src/yui/meta/yui.json
@@ -11,12 +11,6 @@
"yui-log": {
"requires": ["yui-base"]
},
- "yui-soon": {
- "requires": ["yui-base"]
- },
- "yui-soon-nodejs": {
- "requires": ["yui-base"]
- },
"intl-base": {
"requires": ["yui-base"]
}
View
4 src/yui/tests/cli/run.js
@@ -55,12 +55,10 @@ YUI({
'config-test': {
fullpath: 'config-test.js'
},
+
'later-test': {
fullpath: 'later-test.js'
},
- 'soon-test': {
- fullpath: 'soon-test.js'
- },
'namespace-test': {
fullpath: 'namespace-test.js'
},
View
12 src/yui/tests/coverage/index-automated.html
@@ -29,7 +29,6 @@
<script type="text/javascript" src="../../../build/intl-base/intl-base-coverage.js"></script>
<script type="text/javascript" src="../../../build/yui-log/yui-log-coverage.js"></script>
<script type="text/javascript" src="../../../build/yui-later/yui-later-coverage.js"></script>
-<script type="text/javascript" src="../../../build/yui-soon/yui-soon-coverage.js"></script>
<script type="text/javascript" src="../../../build/loader/loader.js"></script>
<script type="text/javascript">
@@ -58,7 +57,7 @@
base: '../../../build/',
loaderPath: 'loader/loader.js',
gconfig: true,
- core: [ 'get', 'features', 'intl-base', 'yui-log', 'yui-later', 'yui-soon', 'loader-base', 'loader-rollup', 'loader-yui3' ],
+ core: ['get', 'features','intl-base','yui-log','yui-later','loader-base','loader-rollup','loader-yui3' ],
gfilter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'raw'
};
@@ -87,18 +86,18 @@
fullpath: './core-tests.js',
requires: [ 'classnamemanager']
},
+
'config-test': {
fullpath: 'config-test.js'
},
+
'later-test': {
fullpath: 'later-test.js'
},
- 'soon-test': {
- fullpath: 'soon-test.js'
- },
'browser-tests': {
fullpath: 'browser-tests.js'
},
+
'namespace-test': {
fullpath: 'namespace-test.js'
},
@@ -113,8 +112,9 @@
fullpath: './ua-tests.js',
requires: [ 'ua-data', 'ua-yui-data', 'test' ]
}
+
}
-}).use('ua-tests', 'seed-tests', 'core-tests', 'config-test', 'later-test', 'soon-test', 'namespace-test', 'array-test', 'object-test', 'lang-test', 'test-console', 'test', function(Y) {
+}).use('ua-tests', 'seed-tests', 'core-tests', 'config-test', 'later-test', 'namespace-test', 'array-test', 'object-test', 'lang-test', 'test-console', 'test', function(Y) {
new Y.Test.Console().render('#log');
//This is a YUITest hack to rename this test for reporting
View
46 src/yui/tests/unit/assets/soon-test.js
@@ -1,46 +0,0 @@
-YUI.add('soon-test', function (Y) {
- Y.SeedTests.add(new Y.Test.Case({
- name: 'Soon tests',
-
- 'test soon(callbackFunction)': function () {
- var test = this,
- count = 0,
- timer = Y.soon(function () {
- count += 1;
-
- if (count > 1) {
- test.resume(function () {
- Y.Assert.fail('soon() callback executed multiple times');
- });
- } else {
- test.resume(function () {
- // Arbitrary timeout to test that the callback doesn't
- // execute again
- test.wait(function () {
- Y.Assert.isTrue(true);
- }, 150);
- });
- }
- });
-
- Y.Assert.areSame(0, count);
- Y.Assert.isObject(timer);
- Y.Assert.isFunction(timer.cancel);
-
- test.wait();
- },
-
- 'test cancel soon(callbackFunction)': function () {
- var count = 0,
- timer = Y.soon(function () {
- count += 1;
- });
-
- timer.cancel();
-
- this.wait(function () {
- Y.Assert.areSame(0, count);
- }, 250);
- }
- }));
-});
View
12 src/yui/tests/unit/coverage.html
@@ -29,7 +29,6 @@
<script type="text/javascript" src="../../../../build/intl-base/intl-base-coverage.js"></script>
<script type="text/javascript" src="../../../../build/yui-log/yui-log-coverage.js"></script>
<script type="text/javascript" src="../../../../build/yui-later/yui-later-coverage.js"></script>
-<script type="text/javascript" src="../../../../build/yui-soon/yui-soon-coverage.js"></script>
<script type="text/javascript" src="../../../../build/loader/loader.js"></script>
<script type="text/javascript">
@@ -58,7 +57,7 @@
base: '../../../../build/',
loaderPath: 'loader/loader.js',
gconfig: true,
- core: ['get', 'features', 'intl-base', 'yui-log', 'yui-later', 'yui-soon', 'loader-base', 'loader-rollup', 'loader-yui3' ],
+ core: ['get', 'features','intl-base','yui-log','yui-later','loader-base','loader-rollup','loader-yui3' ],
gfilter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'raw'
};
@@ -88,18 +87,18 @@
fullpath: './assets/core-tests.js',
requires: [ 'classnamemanager']
},
+
'config-test': {
fullpath: './assets/config-test.js'
},
+
'later-test': {
fullpath: './assets/later-test.js'
},
- 'soon-test': {
- fullpath: './assets/soon-test.js'
- },
'browser-tests': {
fullpath: './assets/browser-tests.js'
},
+
'namespace-test': {
fullpath: './assets/namespace-test.js'
},
@@ -114,8 +113,9 @@
fullpath: './assets/ua-tests.js',
requires: [ 'ua-data', 'ua-yui-data', 'test' ]
}
+
}
-}).use('ua-tests', 'seed-tests', 'core-tests', 'config-test', 'later-test', 'soon-test', 'namespace-test', 'array-test', 'object-test', 'lang-test', 'test-console', 'test', function(Y) {
+}).use('ua-tests', 'seed-tests', 'core-tests', 'config-test', 'later-test', 'namespace-test', 'array-test', 'object-test', 'lang-test', 'test-console', 'test', function(Y) {
new Y.Test.Console().render('#log');
//This is a YUITest hack to rename this test for reporting
View
8 src/yui/tests/unit/index-full.html
@@ -38,11 +38,9 @@
fullpath: './assets/seed-tests.js',
requires: [ 'test']
},
-
'browser-tests': {
fullpath: './assets/browser-tests.js'
},
-
'core-tests': {
fullpath: './assets/core-tests.js',
requires: [ 'classnamemanager']
@@ -55,17 +53,13 @@
'later-test': {
fullpath: './assets/later-test.js'
},
-
- 'soon-test': {
- fullpath: './assets/soon-test.js'
- },
'namespace-test': {
fullpath: './assets/namespace-test.js'
}
}
-}).use('seed-tests', 'core-tests', 'config-test', 'later-test', 'soon-test', 'namespace-test', 'test-console', 'test', function(Y) {
+}).use('seed-tests', 'core-tests', 'config-test', 'later-test', 'namespace-test', 'test-console', 'test', function(Y) {
new Y.Test.Console().render('#log');
//This is a YUITest hack to rename this test for reporting
View
8 src/yui/tests/unit/index-loader.html
@@ -38,11 +38,9 @@
fullpath: './assets/seed-tests.js',
requires: [ 'test']
},
-
'browser-tests': {
fullpath: './assets/browser-tests.js'
},
-
'core-tests': {
fullpath: './assets/core-tests.js',
requires: [ 'classnamemanager']
@@ -56,16 +54,12 @@
fullpath: './assets/later-test.js'
},
- 'soon-test': {
- fullpath: './assets/soon-test.js'
- },
-
'namespace-test': {
fullpath: './assets/namespace-test.js'
}
}
-}).use('seed-tests', 'core-tests', 'config-test', 'later-test', 'soon-test', 'namespace-test', 'test-console', 'test', function(Y) {
+}).use('seed-tests', 'core-tests', 'config-test', 'later-test', 'namespace-test', 'test-console', 'test', function(Y) {
new Y.Test.Console().render('#log');
Y.Test.Runner.run();
View
11 src/yui/tests/unit/index-static.html
@@ -29,7 +29,6 @@
<script type="text/javascript" src="../../../../build/intl-base/intl-base.js"></script>
<script type="text/javascript" src="../../../../build/yui-log/yui-log.js"></script>
<script type="text/javascript" src="../../../../build/yui-later/yui-later.js"></script>
-<script type="text/javascript" src="../../../../build/yui-soon/yui-soon.js"></script>
<!--script type="text/javascript" src="../../../build/loader/loader.js"></script-->
<script type="text/javascript">
@@ -55,7 +54,7 @@
var YUI_config = {
loaderPath: 'loader/loader.js',
gconfig: true,
- core: [ 'get', 'features', 'intl-base', 'yui-log', 'yui-later', 'yui-soon', 'loader-base', 'loader-rollup', 'loader-yui3' ],
+ core: ['get', 'features','intl-base','yui-log','yui-later','loader-base','loader-rollup','loader-yui3' ],
gfilter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'raw'
};
@@ -86,15 +85,15 @@
fullpath: './assets/core-tests.js',
requires: [ 'classnamemanager']
},
+
'config-test': {
fullpath: './assets/config-test.js'
},
+
'later-test': {
fullpath: './assets/later-test.js'
},
- 'soon-test': {
- fullpath: './assets/soon-test.js'
- },
+
'browser-tests': {
fullpath: './assets/browser-tests.js'
},
@@ -114,7 +113,7 @@
}
}
-}).use('ua-tests', 'seed-tests', 'core-tests', 'config-test', 'later-test', 'soon-test', 'namespace-test', 'array-test', 'object-test', 'lang-test', 'test-console', 'test', function(Y) {
+}).use('ua-tests', 'seed-tests', 'core-tests', 'config-test', 'later-test', 'namespace-test', 'array-test', 'object-test', 'lang-test', 'test-console', 'test', function(Y) {
new Y.Test.Console().render('#log');
Y.Test.Runner.setName(TestName);
View
7 src/yui/tests/unit/index.html
@@ -52,7 +52,6 @@
fullpath: './assets/seed-tests.js',
requires: [ 'test']
},
-
'core-tests': {
fullpath: './assets/core-tests.js',
requires: [ 'classnamemanager']
@@ -66,10 +65,6 @@
fullpath: './assets/later-test.js'
},
- 'soon-test': {
- fullpath: './assets/soon-test.js'
- },
-
'browser-tests': {
fullpath: './assets/browser-tests.js'
},
@@ -78,7 +73,7 @@
}
}
-}).use('seed-tests', 'core-tests', 'config-test', 'later-test', 'soon-test', 'namespace-test', 'test-console', 'test', function(Y) {
+}).use('seed-tests', 'core-tests', 'config-test', 'later-test', 'namespace-test', 'test-console', 'test', function(Y) {
new Y.Test.Console().render('#log');
Y.Test.Runner.run();

0 comments on commit dae59cd

Please sign in to comment.
Something went wrong with that request. Please try again.