1 define([ 'util/ensureCallback' ], function (ensureCallback) {
2 return function timeout(duration, fn, callback) {
3 callback = ensureCallback(callback);
5 var id = setTimeout(function () {
6 callback(new Error('Operation timed out'));
11 callback.apply(this, arguments);